Log In  


Cart #knutil_bunpack-3 | 2024-12-21 | Code ▽ | Embed ▽ | No License

Feature Overview

BUNPACK() slice the value with bit width.

  • by specifying the argument after [number w], a value of up to 32 bits can be sliced.
  • set [number s] to a negative value to start the slicing from the decimal point bit.
  • This function consumes 30 Token.
a,b=bunpack(0xf8,0,4,4) -- Value, First bit-shift, bit-width, ...[bit-width]
?a -- 8  (0x8)
?b -- 15 (0xf)

This function is included in the KNUTIL library.

release note


v0.2

  • change table storage order to little endian.

v0.1

  • first release
2



[Please log in to post a comment]