New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

nodeon-crypto

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodeon-crypto

A Collection of crypto helper methods.

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

nodeON-crypto

A Collection of crypto helper methods.

Build Status

Install

Install the module using NPM:

npm install nodeon-crypto --save

Table of Contents

API

Hash a string using bcrypt

helpers.hash(text, optOpts, done)

  • text string The string to hash.
  • optOpts Object= Optionally define options.
  • done Function() Node.js style callback.

Hashes a string using the bcrypt library.

Bcrypt will only hash strings up to 72 chars long. If the passed string is longer than that the helpers.hash method will fail with a warning. To ignore that behavior set the ignoreLimit option to true:


helpers.hash(longString, {ignoreLimit: true}, function(err, res) {
    // Ignoring limit will not create an error
    expect(err).to.be.null;
    expect(res).to.be.a('string');
});

[⬆]

Verify a hashed string match

helpers.hashVerify(hash, text, done)

  • hash string The hashed string.
  • text string The string to test.
  • done Function(boolean) Callback with a single argument, boolean.

Tests if the given string matches the provided hash.

[⬆]

Set a salt string

crypto.setSalt(salt)

  • salt string Any string.

Use it once to set a salt for the crypto functions.

[⬆]

Release History

  • v1.0.1, 28 Feb 2020
    • Updated all dependencies to latest.
  • v1.0.0, 04 May 2016
    • Big Bang

License

Copyright Thanasis Polychronakis. Licensed under the MIT license.

FAQs

Package last updated on 28 Feb 2020

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