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

lazyhash

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

lazyhash

A simple wrapper around node's built-in pbkdf2 functionality.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

A simple wrapper around node's built-in pbkdf2 functionality.

Example

var lazyhash = require('lazyhash');

// create a hash of some text
lazyhash.create('test', function (err, result) {
    
    // check some text against a key and salt
    lazyhash.compare('test', result.salt, result.key, function (err, equal) {

        console.log(equal);

    });

});

API

create(input, callback)

input: the text you want to hash
callback(err, result): result is an object containing the salt and derived key

compare(input, salt, key, callback)

input: the text you want to hash and compare to key
salt: the salt used when generating key
key: the key, for which salt was used, to compare to input's key
callback(err, equal): equal is a boolean, true if the keys match otherwise false

Requirements

This assumes node version >= 0.9.x. Whichever node version changed the crypto lib to return buffers. This code assumes buffers are returned. I built this against node 0.9.3.

Keywords

FAQs

Package last updated on 11 Dec 2012

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