Skip to content

MintPond/hasher-phi2

Repository files navigation

hasher-phi2

This is a Node module for simple hashing of the phi2 algorithm. Native code is adapted from LUX.

This module has been developed and tested on Node v10.16.3 and Ubuntu 16.04 for Phi2 mining pools at MintPond.

Install

Install as Dependency in NodeJS Project

# Install from Github git package

sudo apt-get install build-essential
npm install mintpond/hasher-phi2 --save

-or-

# Install from Github NPM repository

sudo apt-get install build-essential
npm config set @mintpond:registry https://npm.pkg.github.com/mintpond
npm config set //npm.pkg.github.com/:_authToken <MY_GITHUB_AUTH_TOKEN>

npm install @mintpond/hasher-phi2@1.0.0 --save

Install & Test

# Install nodejs v10
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install nodejs -y

# Download hasher-phi1
git clone https://github.com/MintPond/hasher-phi2

# build
cd hasher-phi2
sudo apt-get install build-essential
npm install
npm test

Usage

Hash

const hasher = require('hasher-phi2');

/**
 * Hash the data in a Buffer and return the result in a new Buffer.
 *
 * @param  input   {Buffer}  The data to hash.
 * @returns {Buffer}
 */
const result = hasher.phi2(input);