|
|
@ -14,10 +14,14 @@ func CheckCRC32A(data []byte) uint32 {
|
|
|
|
return binary.BigEndian.Uint32(b)
|
|
|
|
return binary.BigEndian.Uint32(b)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// CheckCRC32AHex is a convenience function that outputs CRC32A (ITU I.363.5 algorithm, popularized by BZIP2) checksum as a hex string.
|
|
|
|
func Crc32A(data []byte) []byte {
|
|
|
|
|
|
|
|
return digest(data)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Crc32AStr is a convenience function that outputs CRC32A (ITU I.363.5 algorithm, popularized by BZIP2) checksum as a hex string.
|
|
|
|
// This function will produce the same results as following PHP code:
|
|
|
|
// This function will produce the same results as following PHP code:
|
|
|
|
// hash('crc32', $data)
|
|
|
|
// hash('crc32', $data)
|
|
|
|
func ChecksumHex(data []byte) string {
|
|
|
|
func Crc32AStr(data []byte) string {
|
|
|
|
b := digest(data)
|
|
|
|
b := digest(data)
|
|
|
|
|
|
|
|
|
|
|
|
return hex.EncodeToString(b)
|
|
|
|
return hex.EncodeToString(b)
|
|
|
|