Namespace: var_int

bitmessage/structs. var_int

Methods

(static) decode(buf) → {DecodeResult}

Decode var_int.
NOTE: rest references input buffer.

Parameters:
Name Type Description
buf Buffer

A buffer that starts with encoded var_int

Source:
Returns:
Type
DecodeResult

(static) encode(value) → {Buffer}

Encode number into var_int.

Parameters:
Name Type Description
value number | Buffer

Input number

Source:
Returns:

Encoded var_int.

Type
Buffer

Type Definitions

DecodeResult

Type:
  • Object
Properties:
Name Type Description
value number

Stored value

length number

var_int full length

rest Buffer

The rest of the input buffer

Source: