Skip to content

Commit 639e3e6

Browse files
committed
feat: toBigInt
1 parent 7b99b73 commit 639e3e6

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ There is no loose variant for this encoding, all bytes can be decoded.
117117

118118
Same as `windows1252toString = createSinglebyteDecoder('windows-1252')`.
119119

120+
### `@exodus/bytes/bigint.js`
121+
122+
##### `toBigInt(arr)`
123+
120124
### `@exodus/bytes/hex.js`
121125

122126
##### `toHex(arr)`

bigint.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { toHex } from '@exodus/bytes/hex.js'
2+
3+
export const toBigInt = (a) => BigInt('0x' + (toHex(a) || '0'))

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"/base58check.js",
6767
"/base64.js",
6868
"/bech32.js",
69+
"/bigint.js",
6970
"/encoding.js",
7071
"/encoding-lite.js",
7172
"/hex.js",
@@ -87,6 +88,7 @@
8788
"./base58check.js": "./base58check.js",
8889
"./base64.js": "./base64.js",
8990
"./bech32.js": "./bech32.js",
91+
"./bigint.js": "./bigint.js",
9092
"./hex.js": {
9193
"node": "./hex.node.js",
9294
"default": "./hex.js"

0 commit comments

Comments
 (0)