node-cryptonight-lite

1.0.1 • Public • Published

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.

Package Sidebar

Install

npm i node-cryptonight-lite

Weekly Downloads

0

Version

1.0.1

License

BSDv3

Last publish

Collaborators

  • excitableaardvark