Documentation ¶
Index ¶
- Constants
- Variables
- func Checksum(data []byte, params Params) uint64
- func ChecksumGSM(data []byte) uint64
- func ToBinString(data uint64) string
- func ToHexString(data uint64) string
- type CRC
- func (this *CRC) Checksum(data []byte) uint64
- func (this *CRC) Complete(crc uint64) uint64
- func (this *CRC) GetParams() Params
- func (this *CRC) GetTable() [256]uint64
- func (this *CRC) Init() uint64
- func (this *CRC) MakeTable() *CRC
- func (this *CRC) Update(crc uint64, data []byte) uint64
- func (this *CRC) WithParams(params Params) *CRC
- func (this *CRC) WithTable(table [256]uint64) *CRC
- type Hash40
- type Params
Constants ¶
View Source
const Size = 5
大小
Variables ¶
View Source
var ( // "CRC-40/GSM" CRC40_GSM = Params{0x0004820009, 0x0000000000, false, false, 0x0000000000} )
类型列表
Functions ¶
Types ¶
type CRC ¶ added in v1.0.10006
type CRC struct {
// contains filtered or unexported fields
}
表格
type Params ¶
type Params struct { // 生成项的简写,以16进制表示。 // 例如:CRC-32 即是0x04C11DB7, // 忽略了最高位的"1",即完整的生成项是0x104C11DB7。 Poly uint64 // 这是算法开始时寄存器(crc)的初始化预置值,十六进制表示。 Init uint64 // 待测数据的每个字节是否按位反转,True或False。 RefIn bool // 在计算后之后,异或输出之前,整个数据是否按位反转,True或False。 RefOut bool // 计算结果与此参数异或后得到最终的CRC值。 XorOut uint64 }
参数 NAME:参数模型名称。 WIDTH:宽度,即CRC比特数
Click to show internal directories.
Click to hide internal directories.