node-cryptonight-lite
v1.0.1
Published
node bindings for cryptonight-lite hashing
Downloads
6
Maintainers
Readme
node-cryptonight-lite
node bindings for cryptonight-lite hashing
Installation
npm install --save node-cryptonight-lite
Testing
Code is linted with standard and tested with Jest. Run npm test
to lint and run tests.
Usage Examples
Synchronous Hashing
const cryptonightLight = require('node-cryptonight-lite').hash
const hash = cryptonightLight(Buffer.from('This is a test'))
console.log(hash) // <Buffer 88 e5 e6 84 db 17 ..>
Asynchronous Hashing
const cryptonightLight = require('node-cryptonight-lite').asyncHash
cryptonightLight(Buffer.from('This is a test'), hash => {
console.log(hash) // <Buffer 88 e5 e6 84 db 17 ..>
})
Promise Wrapper Example
function cryptonightLight(data) {
return new Promise((resolve, reject) => {
require('node-cryptonight-lite').asyncHash(data, hash => {
resolve(hash)
})
})
}
cryptonightLight(Buffer.from('This is a test'))
.then(console.log) // <Buffer 88 e5 e6 84 db 17 ..>
See Also
License
Released under the 3-Clause BSD License. Contains code from the AEON and Monero project. See LICENSE
for more information.