node bindings for cryptonight-lite hashing
npm install --save node-cryptonight-lite
Code is linted with standard and tested with Jest. Run npm test
to lint and run tests.
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 ..>
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 ..>
})
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 ..>
Released under the 3-Clause BSD License. Contains code from the AEON and Monero project. See LICENSE
for more information.