Source File
crc32_generic.go
Belonging Package
hash/crc32
package crc32
func ( uint32) *Table {
:= new(Table)
simplePopulateTable(, )
return
}
const slicing8Cutoff = 16
type slicing8Table [8]Table
func ( uint32) *slicing8Table {
:= new(slicing8Table)
simplePopulateTable(, &[0])
for := 0; < 256; ++ {
:= [0][]
for := 1; < 8; ++ {
= [0][&0xFF] ^ ( >> 8)
[][] =
}
}
return
}
func ( uint32, *slicing8Table, []byte) uint32 {
if len() >= slicing8Cutoff {
= ^
for len() > 8 {
^= uint32([0]) | uint32([1])<<8 | uint32([2])<<16 | uint32([3])<<24
= [0][[7]] ^ [1][[6]] ^ [2][[5]] ^ [3][[4]] ^
[4][>>24] ^ [5][(>>16)&0xFF] ^
[6][(>>8)&0xFF] ^ [7][&0xFF]
= [8:]
}
= ^
}
if len() == 0 {
return
}
return simpleUpdate(, &[0], )
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |