ExcitableAardvark / node-cryptonight-lite

node bindings for cryptonight-lite hashing

Home Page:https://aeon.wiki/Node-cryptonight-lite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

node bindings for cryptonight-lite hashing

https://aeon.wiki/Node-cryptonight-lite

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:JavaScript 54.1%Language:C++ 35.8%Language:Python 10.1%