fast-crc
v1.0.0-beta.0
Published
Fast CRC32 that takes a string and provides a base16 CRC32 string.
Downloads
12
Readme
Fast-CRC
A super simple and super fast way to get a 16base CRC hash of a string. Great for things like creating a hash of a string, filename or file.
Very heavily based on crc-32.
Usage
Node / Browserify / Webpack
const fastCRC = require('fast-crc')
const CRC = fastCRC('Some string') // 7fd1b78e
Webpack with ES6
import fastCRC from 'fast-crc'
const CRC = fastCRC('Some string') // 7fd1b78e
Browser
<script src="fast-crc.js"></script>
<script>
var CRC = fastCRC('Some string') // 7fd1b78e
</script>
Benchmarks
See Bechmarks Repo. About 3.5 times faster than crc and 20 times faster than crc32
Package "fast-crc": 191.215074 ms
Package "crc": 697.319239 ms
Package "crc32": 3687.616722 ms
Acknowledgements
This is basically a copy of crc-32 from SheetJS with the extra code removed and providing the CRC in bash16.
If you require more features, such as handling buffers use crc-32 instead.