Socket
Book a DemoInstallSign in
Socket

crc32-universal

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crc32-universal

CRC32 slice-by-16 implementation in JS with an optional native binding to speed it up even futher

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

crc32-universal

CRC32 slice-by-16 implementation in JS with an optional native binding to speed it up even futher. When used with Webpack/Browserify etc, it bundles the JS version.

npm install crc32-universal

JS version is provided by https://gist.github.com/101arrowz/e58695f7ccfdf74f60ba22018093edea (thank you to @andrewosh for finding that) and the C version is provided by https://github.com/stbrumme/crc32.

For payloads smaller than 256 bytes the JS version is always used as that's faster than context switching to C (Javascript is really fast!).

PR welcome that support the SSE4/Neon optimisations for Intel/ARM for even faster speedup.

Usage

const crc32 = require('crc32-universal')
const uint = crc32(Buffer.from('hello'))
console.log(uint) // 907060870

License

MIT

FAQs

Package last updated on 04 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts