Merge pull request #2486 from nspcc-dev/checksum-doc-upd

crypto: adjust Checksum documentation
This commit is contained in:
Roman Khimov 2022-05-13 15:00:12 +03:00 committed by GitHub
commit 91acd2fac4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,7 +67,8 @@ func Hash160(data []byte) util.Uint160 {
}
// Checksum returns the checksum for a given piece of data
// using sha256 twice as the hash algorithm.
// using DoubleSha256 as the hash algorithm. It returns the
// first 4 bytes of the resulting slice.
func Checksum(data []byte) []byte {
hash := DoubleSha256(data)
return hash[:4]