node-cryptonight
node bindings for cryptonight hashing
node-cryptonight
node bindings for cryptonight hashing
Requirements
node-cryptonight requires Boost and Sodium
Ubuntu
sudo apt-get install libboost-all-dev libsodium-dev
Mac
brew install boost
brew install libsodium
Installation
npm install --save node-cryptonight
Testing
Code is linted with standard and tested with Jest. Run npm test
to lint and run tests.
Usage Examples
Synchronous Hashing
const cryptonight = hashconst hash = console // <Buffer a0 84 f0 1d 14 37 ..>
Synchronous Hashing with variant 1
const cryptonight = hashconst hash = console // <Buffer a0 84 f0 1d 14 37 ..>
Synchronous Hashing with variant 4 and height 123
const cryptonight = hashconst hash = console // <Buffer a0 84 f0 1d 14 37 ..>
Asynchronous Hashing
const cryptonight = asyncHash
Asynchronous Hashing with variant 1
const cryptonight = asyncHash
Asynchronous Hashing with variant 4 and height 123
const cryptonight = asyncHash
Promise Wrapper Example
{ return { }} // <Buffer a0 84 f0 1d 14 37 ..>
See Also
License
Released under the 3-Clause BSD License. Contains code from the Monero project. See LICENSE
for more information.