UNPKG

dvf-client-js

Version:

<img src="https://avatars1.githubusercontent.com/u/56512535?s=200&v=4" align="right" />

14 lines (11 loc) 345 B
/* Returns 2 least significant bit blocks of 31 bits each */ module.exports = (address) => { // address to bits const hBits = BigInt(address).toString(2) // last and second last 31 bit blocks const first31Bits = parseInt(hBits.slice(-31),2) const second31Bits = parseInt(hBits.slice(-62,-31),2) return [first31Bits,second31Bits] }