0.1.0 • Published 1 year ago

crypt3-passwd v0.1.0

Weekly downloads
22
License
-
Repository
github
Last release
1 year ago

CRYPT(3) for node.js

A nodejs CRYPT(3) N-API module for password encrypt and verify.

Installation

$ npm install crypt3-passwd

Usage

encrypt(password: String, salt: String, algo: String)

  • password (required)
  • salt (optional): if missing, will auto create random salt (length=16) without rounds part
  • algo (optional): 'md5'|'sha256'|'sha512'(default)

verify(password: String, hashed: String)

const crypt3 = require('crypt3-passwd')

crypt3.verify(
  'jimmy',
  crypt3.encrypt('jimmy', 'salt', 'sha512')
) 

// user-supplied hashing rounds support as well
crypt3.verify(
  'jimmy',
  crypt3.encrypt('jimmy', 'rounds=1000$salt')
)
// rounds number should be between `1000` and `999999999`
// see: https://man7.org/linux/man-pages/man3/crypt.3.html for more details
0.1.0

1 year ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago