Socket
Socket
Sign inDemoInstall

create-hmac

Package Overview
Dependencies
11
Maintainers
5
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    create-hmac

node style hmacs in the browser


Version published
Weekly downloads
8.8M
increased by2.71%
Maintainers
5
Install size
257 kB
Created
Weekly downloads
 

Package description

What is create-hmac?

The create-hmac package is a Node.js module that allows you to create HMAC (Hash-based Message Authentication Code) digests using a variety of hashing algorithms. HMAC is a mechanism for message authentication using cryptographic hash functions. This package can be used to generate secure, tamper-proof codes for message verification and authentication purposes.

What are create-hmac's main functionalities?

Creating HMAC Digests

This code demonstrates how to create an HMAC digest using the SHA-256 hashing algorithm and a secret key. The 'update' method is used to input the message, and the 'digest' method outputs the HMAC digest in hexadecimal format.

const createHmac = require('create-hmac');
const hmac = createHmac('sha256', 'secret-key').update('message').digest('hex');
console.log(hmac);

Other packages similar to create-hmac

Readme

Source

create-hmac

NPM Package Build Status Dependency status

js-standard-style

Node style HMACs for use in the browser, with native HMAC functions in node. API is the same as HMACs in node:

var createHmac = require('create-hmac')
var hmac = createHmac('sha224', Buffer.from('secret key'))
hmac.update('synchronous write') //optional encoding parameter
hmac.digest() // synchronously get result with optional encoding parameter

hmac.write('write to it as a stream')
hmac.end() //remember it's a stream
hmac.read() //only if you ended it as a stream though

Keywords

FAQs

Last updated on 11 Apr 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc