Imports #
"errors"
"hash"
"internal/byteorder"
"errors"
"hash"
"internal/byteorder"
The size of an Adler-32 checksum in bytes.
const Size = 4
const magic = "adl\x01"
const marshaledSize = *ast.BinaryExpr
mod is the largest prime that is less than 65536.
const mod = 65521
nmax is the largest n such that 255 * n * (n+1) / 2 + (n+1) * (mod-1) <= 2^32-1. It is mentioned in RFC 1950 (search for "5552").
const nmax = 5552
digest represents the partial evaluation of a checksum. The low 16 bits are s1, the high 16 bits are s2.
type digest uint32
func (d *digest) AppendBinary(b []byte) ([]byte, error)
func (d *digest) BlockSize() int
Checksum returns the Adler-32 checksum of data.
func Checksum(data []byte) uint32
func (d *digest) MarshalBinary() ([]byte, error)
New returns a new hash.Hash32 computing the Adler-32 checksum. Its Sum method will lay the value out in big-endian byte order. The returned Hash32 also implements [encoding.BinaryMarshaler] and [encoding.BinaryUnmarshaler] to marshal and unmarshal the internal state of the hash.
func New() hash.Hash32
func (d *digest) Reset()
func (d *digest) Size() int
func (d *digest) Sum(in []byte) []byte
func (d *digest) Sum32() uint32
func (d *digest) UnmarshalBinary(b []byte) error
func (d *digest) Write(p []byte) (nn int, err error)
Add p to the running checksum d.
func update(d digest, p []byte) digest
Generated with Arrow