fast-crc

1.0.0-beta.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i fast-crc

Weekly Downloads

0

Version

1.0.0-beta.0

License

MIT

Last publish

Collaborators

  • ro-savage