Skip to main content

decode

bitcoinjs-lib v1.0.7


bitcoinjs-lib / scriptNumber / decode

Function: decode()

decode(buffer, maxLength?, minimal?): number

Defined in: ts_src/script_number.ts:13

Decodes a script number from a buffer.

Parameters​

buffer​

Uint8Array

The buffer containing the script number.

maxLength?​

number

The maximum length of the script number. Defaults to 4.

minimal?​

boolean

Whether the script number should be minimal. Defaults to true.

Returns​

number

The decoded script number.

Throws​

If the script number overflows the maximum length.

Throws​

If the script number is not minimally encoded when minimal is true.