@gsknnft/bigint-buffer 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +5 -0
- package/README.md +62 -11
- package/dist/node.js +10 -21
- package/helper/bigint.d.ts +2 -2
- package/okg.md +180 -0
- package/package.json +76 -11
- package/rollup.config.js +14 -11
- package/src/conversion/LICENSE +21 -0
- package/src/conversion/README.md +48 -0
- package/src/conversion/docs/README.md +34 -0
- package/src/conversion/docs/functions/base64ToBigint.md +27 -0
- package/src/conversion/docs/functions/bigintToBase64.md +43 -0
- package/src/conversion/docs/functions/bigintToBuf.md +35 -0
- package/src/conversion/docs/functions/bigintToHex.md +43 -0
- package/src/conversion/docs/functions/bigintToText.md +31 -0
- package/src/conversion/docs/functions/bufToBigint.md +25 -0
- package/src/conversion/docs/functions/bufToHex.md +37 -0
- package/src/conversion/docs/functions/bufToText.md +27 -0
- package/src/conversion/docs/functions/hexToBigint.md +29 -0
- package/src/conversion/docs/functions/hexToBuf.md +37 -0
- package/src/conversion/docs/functions/parseHex.md +45 -0
- package/src/conversion/docs/functions/textToBigint.md +27 -0
- package/src/conversion/docs/functions/textToBuf.md +33 -0
- package/src/conversion/docs/functions/toBigIntBE.md +27 -0
- package/src/conversion/docs/functions/toBigIntLE.md +27 -0
- package/src/conversion/docs/functions/toBufferBE.md +33 -0
- package/src/conversion/docs/functions/toBufferLE.md +33 -0
- package/src/conversion/docs/functions/validateBigIntBuffer.md +15 -0
- package/src/conversion/docs/type-aliases/TypedArray.md +11 -0
- package/src/conversion/docs/variables/isNative.md +11 -0
- package/src/conversion/example.cjs +9 -0
- package/src/conversion/example.esm.js +11 -0
- package/src/conversion/package.json +182 -0
- package/src/conversion/pnpm-lock.yaml +5571 -0
- package/src/conversion/tsconfig.rollup.json +9 -0
- package/src/conversion/typedoc.json +5 -0
- package/src/index.bench.ts +116 -119
- package/src/index.spec.ts +44 -78
- package/src/index.ts +40 -35
- package/src/types/bindings.d.t.s +4 -0
- package/tsconfig.json +5 -2
- package/tsconfig.lint.json +5 -0
- package/vitest.config.ts +10 -0
- package/dist/browser.js +0 -75
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
**bigint-conversion**
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
# bigint-conversion
|
|
6
|
+
|
|
7
|
+
## Type Aliases
|
|
8
|
+
|
|
9
|
+
- [TypedArray](type-aliases/TypedArray.md)
|
|
10
|
+
|
|
11
|
+
## Variables
|
|
12
|
+
|
|
13
|
+
- [isNative](variables/isNative.md)
|
|
14
|
+
|
|
15
|
+
## Functions
|
|
16
|
+
|
|
17
|
+
- [base64ToBigint](functions/base64ToBigint.md)
|
|
18
|
+
- [bigintToBase64](functions/bigintToBase64.md)
|
|
19
|
+
- [bigintToBuf](functions/bigintToBuf.md)
|
|
20
|
+
- [bigintToHex](functions/bigintToHex.md)
|
|
21
|
+
- [bigintToText](functions/bigintToText.md)
|
|
22
|
+
- [bufToBigint](functions/bufToBigint.md)
|
|
23
|
+
- [bufToHex](functions/bufToHex.md)
|
|
24
|
+
- [bufToText](functions/bufToText.md)
|
|
25
|
+
- [hexToBigint](functions/hexToBigint.md)
|
|
26
|
+
- [hexToBuf](functions/hexToBuf.md)
|
|
27
|
+
- [parseHex](functions/parseHex.md)
|
|
28
|
+
- [textToBigint](functions/textToBigint.md)
|
|
29
|
+
- [textToBuf](functions/textToBuf.md)
|
|
30
|
+
- [toBigIntBE](functions/toBigIntBE.md)
|
|
31
|
+
- [toBigIntLE](functions/toBigIntLE.md)
|
|
32
|
+
- [toBufferBE](functions/toBufferBE.md)
|
|
33
|
+
- [toBufferLE](functions/toBufferLE.md)
|
|
34
|
+
- [validateBigIntBuffer](functions/validateBigIntBuffer.md)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / base64ToBigint
|
|
6
|
+
|
|
7
|
+
# Function: base64ToBigint()
|
|
8
|
+
|
|
9
|
+
> **base64ToBigint**(`a`): `bigint`
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:330
|
|
12
|
+
|
|
13
|
+
Converts a base64 string to bigint.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### a
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
base64 string. It accepts standard and URL-safe base64 with and without padding
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`bigint`
|
|
26
|
+
|
|
27
|
+
a bigint
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / bigintToBase64
|
|
6
|
+
|
|
7
|
+
# Function: bigintToBase64()
|
|
8
|
+
|
|
9
|
+
> **bigintToBase64**(`a`, `urlsafe`, `padding`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:321
|
|
12
|
+
|
|
13
|
+
Converts an arbitrary-size non-negative bigint to a base64 string
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### a
|
|
18
|
+
|
|
19
|
+
`bigint`
|
|
20
|
+
|
|
21
|
+
a non negative bigint
|
|
22
|
+
|
|
23
|
+
### urlsafe
|
|
24
|
+
|
|
25
|
+
`boolean` = `false`
|
|
26
|
+
|
|
27
|
+
if true Base64 URL encoding is used ('+' and '/' are replaced by '-', '_')
|
|
28
|
+
|
|
29
|
+
### padding
|
|
30
|
+
|
|
31
|
+
`boolean` = `true`
|
|
32
|
+
|
|
33
|
+
if false, padding (trailing '=') is removed
|
|
34
|
+
|
|
35
|
+
## Returns
|
|
36
|
+
|
|
37
|
+
`string`
|
|
38
|
+
|
|
39
|
+
a base64 representation of the input bigint
|
|
40
|
+
|
|
41
|
+
## Throws
|
|
42
|
+
|
|
43
|
+
Thrown if a < 0
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / bigintToBuf
|
|
6
|
+
|
|
7
|
+
# Function: bigintToBuf()
|
|
8
|
+
|
|
9
|
+
> **bigintToBuf**(`a`, `returnArrayBuffer`): `ArrayBuffer` \| `Buffer`\<`ArrayBufferLike`\>
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:144
|
|
12
|
+
|
|
13
|
+
Converts an arbitrary-size non-negative bigint to an ArrayBuffer or a Buffer (default for Node.js)
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### a
|
|
18
|
+
|
|
19
|
+
`bigint`
|
|
20
|
+
|
|
21
|
+
### returnArrayBuffer
|
|
22
|
+
|
|
23
|
+
`boolean` = `false`
|
|
24
|
+
|
|
25
|
+
In Node.js, it forces the output to be an ArrayBuffer instead of a Buffer.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`ArrayBuffer` \| `Buffer`\<`ArrayBufferLike`\>
|
|
30
|
+
|
|
31
|
+
an ArrayBuffer or a Buffer with a binary representation of the input bigint
|
|
32
|
+
|
|
33
|
+
## Throws
|
|
34
|
+
|
|
35
|
+
RangeError if a < 0.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / bigintToHex
|
|
6
|
+
|
|
7
|
+
# Function: bigintToHex()
|
|
8
|
+
|
|
9
|
+
> **bigintToHex**(`a`, `prefix0x`, `byteLength?`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:177
|
|
12
|
+
|
|
13
|
+
Converts a non-negative bigint to a hexadecimal string
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### a
|
|
18
|
+
|
|
19
|
+
`bigint`
|
|
20
|
+
|
|
21
|
+
a non negative bigint
|
|
22
|
+
|
|
23
|
+
### prefix0x
|
|
24
|
+
|
|
25
|
+
`boolean` = `false`
|
|
26
|
+
|
|
27
|
+
set to true to prefix the output with '0x'
|
|
28
|
+
|
|
29
|
+
### byteLength?
|
|
30
|
+
|
|
31
|
+
`number`
|
|
32
|
+
|
|
33
|
+
pad the output to have the desired byte length. Notice that the hex length is double the byte length.
|
|
34
|
+
|
|
35
|
+
## Returns
|
|
36
|
+
|
|
37
|
+
`string`
|
|
38
|
+
|
|
39
|
+
hexadecimal representation of the input bigint
|
|
40
|
+
|
|
41
|
+
## Throws
|
|
42
|
+
|
|
43
|
+
RangeError if a < 0
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / bigintToText
|
|
6
|
+
|
|
7
|
+
# Function: bigintToText()
|
|
8
|
+
|
|
9
|
+
> **bigintToText**(`a`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:204
|
|
12
|
+
|
|
13
|
+
Converts a non-negative bigint representing a binary array of utf-8 encoded text to a string of utf-8 text
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### a
|
|
18
|
+
|
|
19
|
+
`bigint`
|
|
20
|
+
|
|
21
|
+
A non-negative bigint representing a binary array of utf-8 encoded text.
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`string`
|
|
26
|
+
|
|
27
|
+
a string text with utf-8 encoding
|
|
28
|
+
|
|
29
|
+
## Throws
|
|
30
|
+
|
|
31
|
+
RangeError if a < 0.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / bufToBigint
|
|
6
|
+
|
|
7
|
+
# Function: bufToBigint()
|
|
8
|
+
|
|
9
|
+
> **bufToBigint**(`buf`): `bigint`
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:154
|
|
12
|
+
|
|
13
|
+
Converts an ArrayBuffer, TypedArray or Buffer (node.js) to a bigint
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### buf
|
|
18
|
+
|
|
19
|
+
`ArrayBuffer` | `Buffer`\<`ArrayBufferLike`\> | [`TypedArray`](../type-aliases/TypedArray.md)
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
`bigint`
|
|
24
|
+
|
|
25
|
+
a bigint
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / bufToHex
|
|
6
|
+
|
|
7
|
+
# Function: bufToHex()
|
|
8
|
+
|
|
9
|
+
> **bufToHex**(`buf`, `prefix0x`, `byteLength?`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:269
|
|
12
|
+
|
|
13
|
+
Returns the hexadecimal representation of a buffer.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### buf
|
|
18
|
+
|
|
19
|
+
`ArrayBuffer` | `Buffer`\<`ArrayBufferLike`\> | [`TypedArray`](../type-aliases/TypedArray.md)
|
|
20
|
+
|
|
21
|
+
### prefix0x
|
|
22
|
+
|
|
23
|
+
`boolean` = `false`
|
|
24
|
+
|
|
25
|
+
set to true to prefix the output with '0x'
|
|
26
|
+
|
|
27
|
+
### byteLength?
|
|
28
|
+
|
|
29
|
+
`number`
|
|
30
|
+
|
|
31
|
+
pad the output to have the desired byte length. Notice that the hex length is double the byte length.
|
|
32
|
+
|
|
33
|
+
## Returns
|
|
34
|
+
|
|
35
|
+
`string`
|
|
36
|
+
|
|
37
|
+
a string with a hexadecimal representation of the input buffer
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / bufToText
|
|
6
|
+
|
|
7
|
+
# Function: bufToText()
|
|
8
|
+
|
|
9
|
+
> **bufToText**(`buf`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:239
|
|
12
|
+
|
|
13
|
+
Converts an ArrayBuffer, TypedArray or Buffer (in Node.js) containing utf-8 encoded text to a string of utf-8 text
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### buf
|
|
18
|
+
|
|
19
|
+
A buffer containing utf-8 encoded text
|
|
20
|
+
|
|
21
|
+
`ArrayBuffer` | `Buffer`\<`ArrayBufferLike`\> | [`TypedArray`](../type-aliases/TypedArray.md)
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`string`
|
|
26
|
+
|
|
27
|
+
a string text with utf-8 encoding
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / hexToBigint
|
|
6
|
+
|
|
7
|
+
# Function: hexToBigint()
|
|
8
|
+
|
|
9
|
+
> **hexToBigint**(`hexStr`): `bigint`
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:191
|
|
12
|
+
|
|
13
|
+
Converts a hexadecimal string to a bigint
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### hexStr
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
`bigint`
|
|
24
|
+
|
|
25
|
+
a bigint
|
|
26
|
+
|
|
27
|
+
## Throws
|
|
28
|
+
|
|
29
|
+
RangeError if input string does not hold an hexadecimal number
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / hexToBuf
|
|
6
|
+
|
|
7
|
+
# Function: hexToBuf()
|
|
8
|
+
|
|
9
|
+
> **hexToBuf**(`hexStr`, `returnArrayBuffer`): `ArrayBuffer` \| `Buffer`\<`ArrayBufferLike`\>
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:298
|
|
12
|
+
|
|
13
|
+
Converts a hexadecimal string to a buffer
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### hexStr
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
A string representing a number with hexadecimal notation
|
|
22
|
+
|
|
23
|
+
### returnArrayBuffer
|
|
24
|
+
|
|
25
|
+
`boolean` = `false`
|
|
26
|
+
|
|
27
|
+
In Node.js, it forces the output to be an ArrayBuffer instead of a Buffer.
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`ArrayBuffer` \| `Buffer`\<`ArrayBufferLike`\>
|
|
32
|
+
|
|
33
|
+
An ArrayBuffer or a Buffer
|
|
34
|
+
|
|
35
|
+
## Throws
|
|
36
|
+
|
|
37
|
+
RangeError if input string does not hold an hexadecimal number
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / parseHex
|
|
6
|
+
|
|
7
|
+
# Function: parseHex()
|
|
8
|
+
|
|
9
|
+
> **parseHex**(`a`, `prefix0x`, `byteLength?`): `string`
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:119
|
|
12
|
+
|
|
13
|
+
Parses a hexadecimal string for correctness and returns it with or without '0x' prefix, and/or with the specified byte length
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### a
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
the string with an hexadecimal number to be parsed
|
|
22
|
+
|
|
23
|
+
### prefix0x
|
|
24
|
+
|
|
25
|
+
`boolean` = `false`
|
|
26
|
+
|
|
27
|
+
set to true to prefix the output with '0x'
|
|
28
|
+
|
|
29
|
+
### byteLength?
|
|
30
|
+
|
|
31
|
+
`number`
|
|
32
|
+
|
|
33
|
+
pad the output to have the desired byte length. Notice that the hex length is double the byte length.
|
|
34
|
+
|
|
35
|
+
## Returns
|
|
36
|
+
|
|
37
|
+
`string`
|
|
38
|
+
|
|
39
|
+
## Throws
|
|
40
|
+
|
|
41
|
+
RangeError if input string does not hold an hexadecimal number
|
|
42
|
+
|
|
43
|
+
## Throws
|
|
44
|
+
|
|
45
|
+
RangeError if requested byte length is less than the input byte length
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / textToBigint
|
|
6
|
+
|
|
7
|
+
# Function: textToBigint()
|
|
8
|
+
|
|
9
|
+
> **textToBigint**(`text`): `bigint`
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:216
|
|
12
|
+
|
|
13
|
+
Converts a utf-8 string to a bigint (from its binary representaion)
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### text
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
A string text with utf-8 encoding
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`bigint`
|
|
26
|
+
|
|
27
|
+
a bigint representing a binary array of the input utf-8 encoded text
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / textToBuf
|
|
6
|
+
|
|
7
|
+
# Function: textToBuf()
|
|
8
|
+
|
|
9
|
+
> **textToBuf**(`str`, `returnArrayBuffer`): `ArrayBuffer` \| `Buffer`\<`ArrayBufferLike`\>
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:253
|
|
12
|
+
|
|
13
|
+
Converts a string of utf-8 encoded text to an ArrayBuffer or a Buffer (default in Node.js)
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### str
|
|
18
|
+
|
|
19
|
+
`string`
|
|
20
|
+
|
|
21
|
+
A string of text (with utf-8 encoding)
|
|
22
|
+
|
|
23
|
+
### returnArrayBuffer
|
|
24
|
+
|
|
25
|
+
`boolean` = `false`
|
|
26
|
+
|
|
27
|
+
When invoked in Node.js, it can force the output to be an ArrayBuffer instead of a Buffer.
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`ArrayBuffer` \| `Buffer`\<`ArrayBufferLike`\>
|
|
32
|
+
|
|
33
|
+
an ArrayBuffer or a Buffer containing the utf-8 encoded text
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / toBigIntBE
|
|
6
|
+
|
|
7
|
+
# Function: toBigIntBE()
|
|
8
|
+
|
|
9
|
+
> **toBigIntBE**(`buf`): `bigint`
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:63
|
|
12
|
+
|
|
13
|
+
Convert a big-endian buffer into a BigInt
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### buf
|
|
18
|
+
|
|
19
|
+
`Buffer`
|
|
20
|
+
|
|
21
|
+
The big-endian buffer to convert.
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`bigint`
|
|
26
|
+
|
|
27
|
+
A BigInt with the big-endian representation of buf.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / toBigIntLE
|
|
6
|
+
|
|
7
|
+
# Function: toBigIntLE()
|
|
8
|
+
|
|
9
|
+
> **toBigIntLE**(`buf`): `bigint`
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:36
|
|
12
|
+
|
|
13
|
+
Convert a little-endian buffer into a BigInt.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### buf
|
|
18
|
+
|
|
19
|
+
`Buffer`
|
|
20
|
+
|
|
21
|
+
The little-endian buffer to convert
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`bigint`
|
|
26
|
+
|
|
27
|
+
A BigInt with the little-endian representation of buf.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / toBufferBE
|
|
6
|
+
|
|
7
|
+
# Function: toBufferBE()
|
|
8
|
+
|
|
9
|
+
> **toBufferBE**(`num`, `width`): `Buffer`
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:98
|
|
12
|
+
|
|
13
|
+
Convert a BigInt to a big-endian buffer.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### num
|
|
18
|
+
|
|
19
|
+
`bigint`
|
|
20
|
+
|
|
21
|
+
The BigInt to convert.
|
|
22
|
+
|
|
23
|
+
### width
|
|
24
|
+
|
|
25
|
+
`number`
|
|
26
|
+
|
|
27
|
+
The number of bytes that the resulting buffer should be.
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`Buffer`
|
|
32
|
+
|
|
33
|
+
A big-endian buffer representation of num.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / toBufferLE
|
|
6
|
+
|
|
7
|
+
# Function: toBufferLE()
|
|
8
|
+
|
|
9
|
+
> **toBufferLE**(`num`, `width`): `Buffer`
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:80
|
|
12
|
+
|
|
13
|
+
Convert a BigInt to a little-endian buffer.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### num
|
|
18
|
+
|
|
19
|
+
`bigint`
|
|
20
|
+
|
|
21
|
+
The BigInt to convert.
|
|
22
|
+
|
|
23
|
+
### width
|
|
24
|
+
|
|
25
|
+
`number`
|
|
26
|
+
|
|
27
|
+
The number of bytes that the resulting buffer should be.
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`Buffer`
|
|
32
|
+
|
|
33
|
+
A little-endian buffer representation of num.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / validateBigIntBuffer
|
|
6
|
+
|
|
7
|
+
# Function: validateBigIntBuffer()
|
|
8
|
+
|
|
9
|
+
> **validateBigIntBuffer**(): `boolean`
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:49
|
|
12
|
+
|
|
13
|
+
## Returns
|
|
14
|
+
|
|
15
|
+
`boolean`
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[**bigint-conversion**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[bigint-conversion](../README.md) / TypedArray
|
|
6
|
+
|
|
7
|
+
# Type Alias: TypedArray
|
|
8
|
+
|
|
9
|
+
> **TypedArray** = `Int8Array` \| `Uint8Array` \| `Uint8ClampedArray` \| `Int16Array` \| `Uint16Array` \| `Int32Array` \| `Uint32Array` \| `Float32Array` \| `Float64Array` \| `BigInt64Array` \| `BigUint64Array`
|
|
10
|
+
|
|
11
|
+
Defined in: index.ts:106
|