Constructor
new ScriptNum(numnullable, basenullable)
Create a script number.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
num |
Number | String | Buffer | Object |
<nullable> |
|
base |
String | Number |
<nullable> |
Properties:
Name | Type | Description |
---|---|---|
hi |
Number | |
lo |
Number | |
sign |
Number |
- Source:
- See:
Methods
(static) decode(data, minimalnullable, limitnullable) → {ScriptNum}
Decode and verify script number.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
Buffer | ||
minimal |
Boolean |
<nullable> |
Require minimal encoding. |
limit |
Number |
<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, minimalnullable, limitnullable) → {ScriptNum}
Decode and verify script number.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
Buffer | ||
minimal |
Boolean |
<nullable> |
Require minimal encoding. |
limit |
Number |
<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