Variable length string.
Methods
(static) decode(buf) → {DecodeResult}
Decode var_str
.
NOTE: rest
references input buffer.
Parameters:
Name | Type | Description |
---|---|---|
buf |
Buffer | A buffer that starts with encoded |
- Source:
Returns:
- Type
- DecodeResult
(static) encode(str) → {Buffer}
Encode string into var_str
.
Parameters:
Name | Type | Description |
---|---|---|
str |
string | A string |
- Source:
Returns:
Encoded var_str
.
- Type
- Buffer
Type Definitions
DecodeResult
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
str |
number | The string itself |
length |
number |
|
rest |
Buffer | The rest of the input buffer |
- Source: