/hasher-phi1

phi1612 algorithm hashing function for NodeJS.

Primary LanguageCGNU Affero General Public License v3.0AGPL-3.0

hasher-phi1

This is a Node module for simple hashing of the phi1 (phi1612) algorithm. Native code is adapted from LUX.

This module has been developed and tested on Node v10.16.3 and Ubuntu 16.04 for Phi1612 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-phi1 --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-phi1@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-phi1

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

Usage

Hash

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

/**
 * 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 = phi1.phi1612(input);