nightingale/vendor/github.com/m3db/stackadler32
Ulric Qin 70e2cefd98 go mod vendor 2020-11-16 08:56:04 +08:00
..
.gitignore go mod vendor 2020-11-16 08:56:04 +08:00
LICENSE go mod vendor 2020-11-16 08:56:04 +08:00
Readme.md go mod vendor 2020-11-16 08:56:04 +08:00
adler32.go go mod vendor 2020-11-16 08:56:04 +08:00

Readme.md

stackadler32

Note: This is a fork of github.com/sent-hil/adler32 that provides digests that are allocated on the stack and can be incrementally written to. This is useful for places where you perform concurrent checksumming and there's no good place to cache a digest without needing to acquire it expensively (under lock, etc).

Port of adler32 checksum function as described here: https://www.ietf.org/rfc/rfc1950.txt to Go.

Example:

 adler32.Checksum([]byte("Hello World"))

Tests

$ go test
PASS
ok      github.com/sent-hil/adler32     2.429s

$ go test -bench=.
# This library is slightly faster than the one in standard library.
$ go test -bench=.
BenchmarkThis-4            10000            230169 ns/op
BenchmarkStdLib-4          10000            190834 ns/op
PASS
ok      github.com/sent-hil/adler32     6.554s