crc32c

command module
v0.0.0-...-5ebbf05 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 8 Imported by: 0

README

`crc32c` is a trivial program that wraps Go's SSE4.2 accelerated CRC-32C (Castagnoli) implementation.  I needed a fast checksum for amd64 that could be plonked on a number of platforms with minimal fuss.  The most obvious solutions available in FreeBSD base, and its package repository, were surprisingly slow.

`crc32c` does not implement a _check_ or _verify_ mode; plumb the output into `diff(1)`.

----
# dmesg | grep ^CPU | head -n 1
CPU: Intel(R) Xeon(R) E-2224G CPU @ 3.50GHz (3504.34-MHz K8-class CPU)
# uname -srm
FreeBSD 12.2-RELEASE-p6 amd64

# time crc32c blob-1g
7ef14d22  blob-1g
crc32c blob-1g  0.06s user 0.14s system 100% cpu 0.200 total
----

rhash is too slow.

----
# time rhash --crc32c blob-1g
7ef14d22  blob-1g
rhash --crc32c blob-1g  0.62s user 0.15s system 99% cpu 0.768 total
----

openssl (SHA-1) is too slow.

----
# time openssl sha1 blob-1g > /dev/null
openssl sha1 blob-1g > /dev/null  1.16s user 0.11s system 99% cpu 1.267 total
----

cksfv (CRC-32) is too slow.

----
# time cksfv blob-1g > /dev/null
cksfv blob-1g > /dev/null  2.13s user 0.28s system 99% cpu 2.415 total
----

cksum (CRC-32?) is too slow.

----
# time cksum blob-1g > /dev/null
cksum blob-1g > /dev/null  2.54s user 0.18s system 99% cpu 2.724 total
----

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL