Class: ScriptNum

script.ScriptNum(numopt, nullable, baseopt, nullable)

Script Number

Constructor

new ScriptNum(numopt, nullable, baseopt, nullable)

Create a script number.

Parameters:
Name Type Attributes Description
num Number | String | Buffer | Object <optional>
<nullable>
base String | Number <optional>
<nullable>
Properties:
Name Type Description
hi Number
lo Number
sign Number
Source:
See:

Methods

(static) decode(data, minimalopt, nullable, limitopt, nullable) → {ScriptNum}

Decode and verify script number.

Parameters:
Name Type Attributes Description
data Buffer
minimal Boolean <optional>
<nullable>

Require minimal encoding.

limit Number <optional>
<nullable>

Size limit.

Source:
Returns:
Type
ScriptNum

(static) isMinimal(data) → {Boolean}

Test wether a serialized script number is in its most minimal form.

Parameters:
Name Type Description
data Buffer
Source:
Returns:
Type
Boolean

(static) isScriptNum(obj) → {Boolean}

Test whether object is a script number.

Parameters:
Name Type Description
obj Object
Source:
Returns:
Type
Boolean

(private) _decode(data) → {ScriptNum}

Instantiate script number from serialized data.

Parameters:
Name Type Description
data Buffer
Source:
Returns:
Type
ScriptNum

(private) decode(data, minimalopt, nullable, limitopt, nullable) → {ScriptNum}

Decode and verify script number.

Parameters:
Name Type Attributes Description
data Buffer
minimal Boolean <optional>
<nullable>

Require minimal encoding.

limit Number <optional>
<nullable>

Size limit.

Source:
Returns:
Type
ScriptNum

encode() → {Buffer}

Serialize script number.

Source:
Returns:
Type
Buffer

getInt() → {Number}

Cast to int32.

Source:
Returns:
Type
Number

inspect() → {String}

Inspect script number.

Source:
Returns:
Type
String