HashData get hash of one hashType
(hashType *HashType, data []byte, params ...any)
| 94 | |
| 95 | // HashData get hash of one hashType |
| 96 | func HashData(hashType *HashType, data []byte, params ...any) string { |
| 97 | h := hashType.NewFunc(params...) |
| 98 | h.Write(data) |
| 99 | return hex.EncodeToString(h.Sum(nil)) |
| 100 | } |
| 101 | |
| 102 | // HashReader get hash of one hashType from a reader |
| 103 | func HashReader(hashType *HashType, reader io.Reader, params ...any) (string, error) { |
no test coverage detected