SHA256Prefix computes the SHA-256 digest of data and returns its first twenty lowercase hex digits.
(data []byte)
| 30 | // SHA256Prefix computes the SHA-256 digest of data and returns |
| 31 | // its first twenty lowercase hex digits. |
| 32 | func SHA256Prefix(data []byte) string { |
| 33 | h := sha256.New() |
| 34 | h.Write(data) |
| 35 | return fmt.Sprintf("%x", h.Sum(nil))[:20] |
| 36 | } |
| 37 | |
| 38 | // SHA1Prefix computes the SHA-1 digest of data and returns |
| 39 | // its first twenty lowercase hex digits. |
no test coverage detected