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

hmac-blake2b

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hmac-blake2b

HMAC backed by BLAKE2b

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
269
decreased by-86.34%
Maintainers
1
Weekly downloads
 
Created
Source

hmac-blake2b

HMAC based on BLAKE2b

Even though BLAKE2b is designed to also work as a MAC, specifications like Noise call for a HMAC.

Usage

var sodium = require('sodium-universal')
var hmac = require('hmac-blake2b')

var mac = Buffer.alloc(hmac.BYTES)
var key = Buffer.alloc(hmac.KEYBYTES)
sodium.randombytes_buf(key)

var data = Buffer.from('some data')

hmac(mac, data, key)

API

hmac.BYTES

Size of the output MAC in bytes

hmac.KEYBYTES

RFC2104 recommended size of the key in bytes.

hmac(out, data, key)

Computes a HMAC from data with key and writes it into out.

  • out must be a Buffer or Uint8Array of length hmac.BYTES
  • data must be a Buffer, Uint8Array or Array of Buffers or Uint8Arrays.
  • key must be a Buffer or Uint8Array. Per the HMAC spec key can be as small as 1 byte, in which case it is right-padded with NUL bytes, or any size larger than hmac.KEYBYTES in which case it is hashed down to fit. The recommended size by the spec is hmac.KEYBYTES

Install

npm install hmac-blake2b

License

ISC

Keywords

FAQs

Package last updated on 26 Apr 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