jacdac.util

Module Contents

Functions

now()

hex_num(n[, len])

buf2hex(buf)

hex2buf(s)

u16(buf, off)

set_u16(buf, off, val)

u32(buf, off)

hash(buf[, bits])

fnv1(data)

short_id(longid)

crc16(buf[, start, end])

color_to_rgb() → Tuple[int, int, int])

Maps various format to a r,g,b tuple

Attributes

_hex

jacdac.util._hex = '0123456789abcdef'
jacdac.util.now()
jacdac.util.hex_num(n: int, len: int = 8)
jacdac.util.buf2hex(buf: bytes)
jacdac.util.hex2buf(s: str)
jacdac.util.u16(buf: bytes, off: int)
jacdac.util.set_u16(buf: bytearray, off: int, val: int)
jacdac.util.u32(buf: bytes, off: int)
jacdac.util.hash(buf: bytes, bits: int = 30)
jacdac.util.fnv1(data: bytes)
jacdac.util.short_id(longid: bytes | str)
jacdac.util.crc16(buf: bytes, start: int = 0, end: int = None)
jacdac.util.color_to_rgb(rgb: int | Tuple[int, int, int] | List[int], default: Tuple[int, int, int] = (0, 0, 0)) Tuple[int, int, int]

Maps various format to a r,g,b tuple