File: utils.coffee

Defined in: src

Variables Summary

MAX_SAFE_HIGH =
0x1fffff

Method Summary

Method Details

~ (Integer or bignum) parseCBORint(ai, buf)

Parse an integer of 1,4, or 8 bytes.

Parameters:

  • ai ( Integer ) the additional information from the input stream
  • buf ( Buffer ) the appropriate number of bytes based on ai

Returns:

  • Integer or bignum

~ (Number) parseCBORfloat(buf)

Parse an IEEE754 half-, single-, or double-precision float.

Parameters:

  • buf ( Buffer ) 2,4, or 8 bytes to parse from

Returns:

  • Number

~ (Buffer) hex(s)

Decode a hex string into a buffer

Returns:

  • Buffer

~ (Buffer) bin(s)

Decode a binary string (e.g. '1001') into a buffer

Returns:

  • Buffer

~ (void) extend(old, adds...)

Copy all of keys from the second and subsequent objects into the first object.

Parameters:

  • old ( Object ) optional object to copy into (default: {})
  • adds ( Object* ) optional additional objects to copy on top. These get copied left to right, with later objects overwriting the keys from previous ones.

~ (Boolean) arrayEqual(a, b)

Are all of the items in two arrays the same?

Parameters:

  • a ( Array )
  • b ( Array )

Returns:

  • Boolean

~ (void) bufferEqual(a, b)

Do the two buffers contain the same bytes?

~ (bignumber) bufferToBignumber(buf)

Convert a a buffer to a bignumber

Parameters:

  • buf ( Buffer ) the buffer to convert

Returns:

  • bignumber

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: