?
This document uses PHP Chinese website manual Release
import "hash/crc64"
概述
索引
Package crc64 實(shí)現(xiàn)64位循環(huán)冗余校驗(yàn)或 CRC-64 校驗(yàn)和。有關(guān)信息,請參閱http://en.wikipedia.org/wiki/Cyclic_redundancy_check。
常量
func Checksum(data []byte, tab *Table) uint64
func New(tab *Table) hash.Hash64
func Update(crc uint64, tab *Table, p []byte) uint64
type Table
func MakeTable(poly uint64) *Table
crc64.go
預(yù)定義的多項(xiàng)式。
const ( // ISO多項(xiàng)式,在ISO 3309中定義并用于HDLC。 ISO = 0xD800000000000000 // ECMA多項(xiàng)式,在ECMA 182中定義。 ECMA = 0xC96C5795D7870F42)
CRC-64校驗(yàn)和的大小(以字節(jié)為單位)。
const Size = 8
func Checksum(data []byte, tab *Table) uint64
校驗(yàn)和使用表格表示的多項(xiàng)式返回?cái)?shù)據(jù)的 CRC-64 校驗(yàn)和。
func New(tab *Table) hash.Hash64
New 創(chuàng)建一個(gè)新的 hash.Hash64 ,使用 Table 表示的多項(xiàng)式計(jì)算 CRC-64 校驗(yàn)和。它的 Sum 方法將以 big-endian 字節(jié)順序排列值。
func Update(crc uint64, tab *Table, p []byte) uint64
更新返回將 p 中的字節(jié)添加到 crc 的結(jié)果。
表格是一個(gè)256字的表格,表示高效處理的多項(xiàng)式。
type Table [256]uint64
func MakeTable(poly uint64) *Table
MakeTable 返回一個(gè)由指定多項(xiàng)式構(gòu)成的表。該表的內(nèi)容不得修改。