Utility functions for Polis hashes and targets
Last updated 3 years ago by polispay .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install polis-util 
SYNC missed versions from official npm registry.


npm version Build Status Dependency Status

Utility functions for Polis hashes and targets


npm install polis-util



Takes a hex string that contains a Polis hash as input, and returns a Polis-protocol-friendly little-endian Buffer. Throws an error if the hex string is not of length 64 (representing a 256-bit hash).


Converts the difficulty target target to its compact representation (used in the "bits" field in block headers). target should be a Buffer (little-endian, the zeroes should be at the end). Returns a number.


Converts the compressed target integer bits to its target hash representation. Returns a Buffer.

Current Tags

  • 2.0.3                                ...           latest (3 years ago)

1 Versions

  • 2.0.3                                ...           3 years ago
Maintainers (1)
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 2
Dependencies (2)
Dev Dependencies (6)

Copyright 2014 - 2016 © taobao.org |