Home Reference Source
public class | source

Serialization

You can directly use an instance of this class. serialization

Method Summary

Public Methods
public

convertBigNumber(bigNumber: *, length: *): *

public

deserializeBigInteger(buffer: *): *

public

deserializeBigNumber(buffer: *, offset: *): {"number": *, "newOffset": *}

Deserialize a Big Number object from an optimal Buffer based on https://stackoverflow.com/questions/8482309/converting-javascript-integer-to-byte-array-and-back

public

deserializeHashOptimized(buffer: *, offset: *): *

public

deserializeNumber(buffer: *): *

public

deserializeNumber(buffer: *): *

public

deserializeNumber1Bytes(buffer: *, offset: number): *

public

deserializeNumber2Bytes(buffer: *, offset: number): *

public

deserializeNumber3Bytes(buffer: *, offset: number): *

public

deserializeNumber4Bytes(buffer: *, offset: number): *

public

deserializeNumber4Bytes_Positive(buffer: *, offset: number): *

public

deserializeNumber7Bytes(buffer: *, offset: number): *

public

Returns the position of most significant bit of 1 Eg: for n = 00000000000000000000000000001010 returns 3

public

serializeBigInteger(data: *): *

public

serializeBigNumber(data: *): *

public
public
public

serializeNumber1Byte(data: *): *

public

serializeNumber2Bytes(data: *): *

public

serializeNumber3Bytes(data: *): *

public

serializeNumber4Bytes(data: *): *

public

serializeNumber7Bytes(long: *): *

public

serializeToFixedBuffer(noBytes: *, buffer: *): Buffer

Convers buffer to a Fixed Length buffer

Public Methods

public convertBigNumber(bigNumber: *, length: *): * source

Params:

NameTypeAttributeDescription
bigNumber *
length *

Return:

*

public deserializeBigInteger(buffer: *): * source

Params:

NameTypeAttributeDescription
buffer *

Return:

*

public deserializeBigNumber(buffer: *, offset: *): {"number": *, "newOffset": *} source

Deserialize a Big Number object from an optimal Buffer based on https://stackoverflow.com/questions/8482309/converting-javascript-integer-to-byte-array-and-back

Params:

NameTypeAttributeDescription
buffer *
offset *

Return:

{"number": *, "newOffset": *}

public deserializeHashOptimized(buffer: *, offset: *): * source

Params:

NameTypeAttributeDescription
buffer *
offset *

Return:

*

public deserializeNumber(buffer: *): * source

Params:

NameTypeAttributeDescription
buffer *

Return:

*

public deserializeNumber(buffer: *): * source

Params:

NameTypeAttributeDescription
buffer *

Return:

*

public deserializeNumber1Bytes(buffer: *, offset: number): * source

Params:

NameTypeAttributeDescription
buffer *
offset number
  • optional
  • default: 0

Return:

*

public deserializeNumber2Bytes(buffer: *, offset: number): * source

Params:

NameTypeAttributeDescription
buffer *
offset number
  • optional
  • default: 0

Return:

*

public deserializeNumber3Bytes(buffer: *, offset: number): * source

Params:

NameTypeAttributeDescription
buffer *
offset number
  • optional
  • default: 0

Return:

*

public deserializeNumber4Bytes(buffer: *, offset: number): * source

Params:

NameTypeAttributeDescription
buffer *
offset number
  • optional
  • default: 0

Return:

*

public deserializeNumber4Bytes_Positive(buffer: *, offset: number): * source

Params:

NameTypeAttributeDescription
buffer *
offset number
  • optional
  • default: 0

Return:

*

public deserializeNumber7Bytes(buffer: *, offset: number): * source

Params:

NameTypeAttributeDescription
buffer *
offset number
  • optional
  • default: 0

Return:

*

public mostSignificantOneBitPosition(n: *): number source

Returns the position of most significant bit of 1 Eg: for n = 00000000000000000000000000001010 returns 3

Params:

NameTypeAttributeDescription
n *

Return:

number

public serializeBigInteger(data: *): * source

Params:

NameTypeAttributeDescription
data *

Return:

*

public serializeBigNumber(data: *): * source

Serialize a Big Number object into an optimal Buffer based on https://stackoverflow.com/questions/8482309/converting-javascript-integer-to-byte-array-and-back

Params:

NameTypeAttributeDescription
data *

Return:

*

public serializeBufferRemovingLeadingZeros(buffer: *): * source

Params:

NameTypeAttributeDescription
buffer *

Return:

*

public serializeHashOptimized(hash: *): * source

Params:

NameTypeAttributeDescription
hash *

Return:

*

public serializeNumber1Byte(data: *): * source

Params:

NameTypeAttributeDescription
data *

Return:

*

public serializeNumber2Bytes(data: *): * source

Params:

NameTypeAttributeDescription
data *

Return:

*

public serializeNumber3Bytes(data: *): * source

Params:

NameTypeAttributeDescription
data *

Return:

*

public serializeNumber4Bytes(data: *): * source

Params:

NameTypeAttributeDescription
data *

Return:

*

public serializeNumber7Bytes(long: *): * source

Params:

NameTypeAttributeDescription
long *

Return:

*

public serializeToFixedBuffer(noBytes: *, buffer: *): Buffer source

Convers buffer to a Fixed Length buffer

Params:

NameTypeAttributeDescription
noBytes *
buffer *

Return:

Buffer