Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crc32crypto

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

crc32crypto

Crypto-like CRC32 calculation

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

CRC32 like Crypto

This small module creates CRC32 checksum in Crypto style.

In order to access the module use require('crc32Crypto').

In case you just downloaded the .js file, use require('path/to/crc32crypto.js').

crc32crypto.createHash(algorithm)

Creates a crc32 hash object.

In order to create a CRC32 checksum set algorithm as crc32. If algorithm differs from crc32 this function creates a new Crypto hash with that algorithm instead.

hash.update(data)

Just like in Crypto, appends a new chunk of data to the hash. This function may be called as many times as it is needed.

data argument expects string or Buffer object.

Unlike Crypto, if data is not a string or Buffer it is coerced to string. That is, hash.update(new Buffer("123")) and hash.update(123) is essentially the same.

hash.digest(encoding='binary')

Returns checksum of all data passed via hash.update(). The encoding is one of hex, binary and base64.

Unlike Crypto, this module doesn't "lock" the data after digest is returned.

Keywords

FAQs

Package last updated on 06 Aug 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc