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

bitbufhash

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitbufhash

Arbitrary bit length hashes and hmacs from arbitrary bit length data and key.

  • 0.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

In a Nutshell

This is a single function package implementing an arbitrary bit length hash and hmac from arbitrary length input and key. Input and key can be either string, Buffer, or in case of non-byte-aligned cases, a BitBuf object. This entire function is an extension to BitBuf.

Reference

bitBufHash(data, key, digestBitLength)

const bitBufHash = require('bitbufhash');
console.log(bitBufHash('foo', 'bar', 27, 'sha256').toString());
const bitBufHash = require('bitbufhash');
const BitBuf = require('bitbuf');
console.log(bitBufHash(BitBuf.from('010101'), BitBuf.from('1001001101'), 13, 'md5').toString());

Just figure it out. Length of the hash is calculated into the hash, so same key and same data produce totally different hash values, if the length differs (i.e. the hash is not just truncated ans therefore share a common prefix).

Author

Timo J. Rinne tri@iki.fi

License

GPL-2.0

Keywords

FAQs

Package last updated on 07 Jan 2018

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