toWords

Converts an array of bytes into wordd ushort array.

ushort[]
toWords
(
ubyte[] bytes
)

Return Value

Type: ushort[]

An ushort array that rapresents words

Examples

assert([0x10].toWords() == [0x10]);
assert([0, 0xAB].toWords() == [0xAB00]);
assert([0x20, 0x0].toWords() == [0x20]);
assert([0x10, 0x20, 0x30, 0x40, 0x50].toWords() == [0x2010, 0x4030, 0x50]);

Meta