@pacificdatascience/cipher
v1.0.7
Published
Secure hashing and comparison
Downloads
9
Maintainers
Readme
Asynchronous Strong Hashing Package
This package uses asynchronous scrypt along with a random salt to create secure hashes.
Installation
npm install @pacificdatascience/cipher
Usage
const cipher = require('@pacificdatascience/cipher')
const hash = await cipher.hash('some text')
return await cipher.compare('some text', hash)
const encrypted = await cipher.encrypt('password', 'salt', { id: 1234, title: 'Sample text' })
const decrypted = await cipher.decrypt('password', 'salt', encrypted)