SHA256sum computes a cryptographic hash. Still used for proof-of-work challenges where we need the security properties of a cryptographic hash function.
(text string)
| 11 | // SHA256sum computes a cryptographic hash. Still used for proof-of-work challenges |
| 12 | // where we need the security properties of a cryptographic hash function. |
| 13 | func SHA256sum(text string) string { |
| 14 | hash := sha256.New() |
| 15 | hash.Write([]byte(text)) |
| 16 | return hex.EncodeToString(hash.Sum(nil)) |
| 17 | } |
| 18 | |
| 19 | // FastHash is a high-performance non-cryptographic hash function suitable for |
| 20 | // internal caching, policy rule identification, and other performance-critical |