A simple utility library.
compare two arrays
-
a
type: array
a
-
b
type: array
b
Returns: boolean
convert a plain buffer to a hex string
-
bin
type: plainbuffer
binary buffer
Returns: string
copy len bytes from src at src index to dst at dst index
-
number
type: array
src
-
number
type: int
src index
-
number
type: array
dst
-
number
type: int
dst index
-
number
type: int
len
Returns:
calculate crc16 of the buffer
-
buf
type: bytearray
buffer
Returns: uint16
convert twos complement to int
-
twosComplement
type: bytearray
twos complement
-
numberBytes
type: int
number of bytes in towsComplement
Returns: int
convert hex string to a plain buffer
-
hex
type: string
hex string
Returns: plain buffer
convert host to network byte order (uint32)
-
number
type: uint32
uint32
Returns: uint32
convert host to network byte order (uint16)
-
number
type: uint16
uint16
Returns: uint16
reverse the bytes in a plain buffer
-
bin
type: plainbuffer
binary buffer
Returns: plain buffer