new util.LongBits(lo, hi)
Constructs new long bits.
Parameters:
lo |
number |
Low 32 bits, unsigned |
hi |
number |
High 32 bits, unsigned |
Members
-
hi { number }
-
High bits.
-
lo { number }
-
Low bits.
-
util.LongBits.zero { util.LongBits }
-
Zero bits.
-
util.LongBits.zeroHash { string }
-
Zero hash.
Methods
-
length(){ number }
-
Calculates the length of this longbits when encoded as a varint.
Returns:
number Length -
toHash(){ string }
-
Converts this long bits to a 8 characters long hash.
Returns:
string Hash -
toLong(unsigned){ Long }
-
Converts this long bits to a long.
Parameters:
unsignedboolean false optional Whether unsigned or not
Returns:
Long Long -
toNumber(unsigned){ number }
-
Converts this long bits to a possibly unsafe JavaScript number.
Parameters:
unsignedboolean false optional Whether unsigned or not
Returns:
number Possibly unsafe number -
zzDecode(){ util.LongBits }
-
Zig-zag decodes this long bits.
Returns:
util.LongBits this -
zzEncode(){ util.LongBits }
-
Zig-zag encodes this long bits.
Returns:
util.LongBits this -
util.LongBits.from(value){ util.LongBits }
-
Constructs new long bits from a number, long or string.
Parameters:
valueLong | number | string Value
Returns:
util.LongBits Instance -
util.LongBits.fromHash(hash){ util.LongBits }
-
Constructs new long bits from the specified 8 characters long hash.
Parameters:
hashstring Hash
Returns:
util.LongBits Bits -
util.LongBits.fromNumber(value){ util.LongBits }
-
Constructs new long bits from the specified number.
Parameters:
valuenumber Value
Returns:
util.LongBits Instance