js-hashrate-parser

0.0.6 • Public • Published

js-hashrate-parser

Installation

npm install js-hashrate-parser

Usage

parse(hashrateString)

Accepts a hashrate string and will return a bignumber

const Hashrate = require('js-hashrate-parser');

Hashrate.parse('1 H/s'); // 1
Hashrate.parse('1 Sol/s'); // 1
Hashrate.parse('1 KH/s'); // 1000
Hashrate.parse('1 KSol/s'); // 1000

toString(hashrateNumber)

Accepts a hashrate number and returns a hashrate string. Input can be a string of a number, a number, or a bignumber.

const Hashrate = require('js-hashrate-parser');

Hashrate.toString(6589270000000000000); // 6.59 EH/s
Hashrate.toString('1000'); // 1 Kh/s
Hashrate.toString(new Bignumber(1)); // 1 H/s

https://www.poolminer.io

Readme

Keywords

none

Package Sidebar

Install

npm i js-hashrate-parser

Weekly Downloads

2

Version

0.0.6

License

ISC

Unpacked Size

3.63 kB

Total Files

5

Last publish

Collaborators

  • hbeckeri