String returns a string representation of the hash
()
| 153 | |
| 154 | // String returns a string representation of the hash |
| 155 | func (h *ImageHash) String() string { |
| 156 | switch h.hashType { |
| 157 | case HashTypeSHA256: |
| 158 | return fmt.Sprintf("SHA256:%x", h.sha256Hash) |
| 159 | case HashTypeDct: |
| 160 | return fmt.Sprintf("DctHash:%v", h.dctHash) |
| 161 | default: |
| 162 | return fmt.Sprintf("unknown(%d)", h.hashType) |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | // Len returns the length of the hash data (excluding type byte) |
| 167 | func (h *ImageHash) Len() int { |
no outgoing calls