Len returns the length of the hash data (excluding type byte)
()
| 165 | |
| 166 | // Len returns the length of the hash data (excluding type byte) |
| 167 | func (h *ImageHash) Len() int { |
| 168 | switch h.hashType { |
| 169 | case HashTypeSHA256: |
| 170 | return 32 |
| 171 | case HashTypeDct: |
| 172 | return len(h.dctHash) * 4 // float32 is 4 bytes |
| 173 | default: |
| 174 | return 0 |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | // calcDct2Hash calculates the DCT hash for the given image data buffer |
| 179 | func (h *ImageHash) calcDct2Hash(buf []byte) error { |
no outgoing calls