Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func EqualSumECMA ¶
EqualSumECMA compares CRC64 hash using crc64.ECMA table. It returns if the sum matches to the hash of b.
func EqualSumISO ¶
EqualSumISO compares CRC64 hash using crc64.ISO table. It returns if the sum matches to the hash of b.
func SumECMA ¶
SumECMA returns CRC64 hash using crc64.ECMA table. It uses hash/crc64.New.
Example ¶
package main import ( "encoding/hex" "fmt" "github.com/aileron-projects/go/zhash/zcrc64" ) func main() { // Calculate CRC64 hash using ECMA table. // Validation data can be generated with: // - https://www.sunshine2k.de/coding/javascript/crc/crc_js.html // - https://toolkitbay.com/tkb/tool/CRC-64 sum := zcrc64.SumECMA([]byte("Hello Go!")) encoded := hex.EncodeToString(sum) fmt.Println(len(sum), encoded) }
Output: 8 85d207c9ff681c7c
func SumISO ¶
SumISO returns CRC64 hash using crc64.ISO table. It uses hash/crc64.New.
Example ¶
package main import ( "encoding/hex" "fmt" "github.com/aileron-projects/go/zhash/zcrc64" ) func main() { // Calculate CRC64 hash using ISO table. // Validation data can be generated with: // - https://www.sunshine2k.de/coding/javascript/crc/crc_js.html // - https://toolkitbay.com/tkb/tool/CRC-64 sum := zcrc64.SumISO([]byte("Hello Go!")) encoded := hex.EncodeToString(sum) fmt.Println(len(sum), encoded) }
Output: 8 d22707d9ac3eeee2
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.