node-bitarray icon indicating copy to clipboard operation
node-bitarray copied to clipboard

Inconsistent API: fill(), octet(), and fromHex() are little-endian. Everything else is big-endian.

Open jamesrom opened this issue 10 years ago • 1 comments

  • fill() appends 0's to the end of the array, instead of prepending.
  • octet() is just shorthand for fill(8) so it suffers the same issue.
  • fromHex('F0') returns [0, 0, 0, 0, 1, 1, 1, 1], instead of [1, 1, 1, 1, 0, 0, 0, 0].

jamesrom avatar Oct 06 '15 13:10 jamesrom

toNumber() is little-endian as well.

YoshGuenther avatar Aug 05 '16 05:08 YoshGuenther