Class: bitutils

bitutils

Constructor

new bitutils()

Source:

Methods

(static) bytesFromWord(w, dest, destOffset)

splits a word into two bytes and writes the resulting two bytes into an existing array. The bytes are not returned as an array or object because allocations are expensive.
Parameters:
Name Type Description
w Number the word to split
dest Uint8Array the destination array
destOffset Number the offset in the destination array, start of the two bytes
Source:

(static) extractBits(bytes, parts, retn, offset)

takes a number of unsigned integers from an array of bytes. See the emulator-documentation for details.
Parameters:
Name Type Description
bytes Uint8Array the source bytes
parts Number length of the parts to extract
retn Uint8Array to store the result in, has to be of the same length as parts
offset Number the offset in bytes to start extracting
Source:

(static) wordFromBytes(b1, b2) → {Number}

combines two bytes into one word
Parameters:
Name Type Description
b1 Number the most significant byte
b2 Number the last significant byte
Source:
Returns:
word
Type
Number