Imports #
"errors"
"hash"
"internal/byteorder"
"errors"
"hash"
"internal/byteorder"
The size of an Adler-32 checksum in bytes.
const Size = 4const magic = "adl\x01"const marshaledSize = *ast.BinaryExprmod is the largest prime that is less than 65536.
const mod = 65521nmax 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 = 5552digest represents the partial evaluation of a checksum. The low 16 bits are s1, the high 16 bits are s2.
type digest uint32func (d *digest) AppendBinary(b []byte) ([]byte, error)func (d *digest) BlockSize() intChecksum returns the Adler-32 checksum of data.
func Checksum(data []byte) uint32func (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.Hash32func (d *digest) Reset()func (d *digest) Size() intfunc (d *digest) Sum(in []byte) []bytefunc (d *digest) Sum32() uint32func (d *digest) UnmarshalBinary(b []byte) errorfunc (d *digest) Write(p []byte) (nn int, err error)Add p to the running checksum d.
func update(d digest, p []byte) digestGenerated with Arrow