MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / Len

Method Len

testutil/image_hash.go:167–176  ·  view source on GitHub ↗

Len returns the length of the hash data (excluding type byte)

()

Source from the content-addressed store, hash-verified

165
166// Len returns the length of the hash data (excluding type byte)
167func (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
179func (h *ImageHash) calcDct2Hash(buf []byte) error {

Callers 2

TestDCT2HashCalcMethod · 0.45
deepEqualFunction · 0.45

Calls

no outgoing calls

Tested by 1

TestDCT2HashCalcMethod · 0.36