32-bit AND (&) number.and32(other) equivalent to (number & other)
8-bit AND (&) NOTE: Assumes both operands are in the range [0, 255] number.and8(other) equivalent to (number & other)
A tuple containing 4 bytes comprising a 4-byte integer. b1 is the least significant byte, b4 is the most significant byte. All functions operating on this are LSB first. The bytes are always unsigned, from 0 to 255. WARNING: This library contains no safety bound checks to guarantee that these bytes stay in the 0-255 range. If these values go out of bounds, the behaviour is undefined.
De-composes an integer into 4 unsigned bytes.
Produces a signed integer from the bitstring. Input string may contain whitespace for padding.
32-bit NOT (~) number.not32() equivalent to (~number)
8-bit NOT (~) NOTE: Assumes number is in the range [0, 255] number.not8() equivalent to (~number)
32-bit OR (|) number.or32(other) equivalent to (number | other)
8-bit OR (|) NOTE: Assumes both operands are in the range [0, 255] number.or8(other) equivalent to (number | other)
Replaces the byte in the n-th position with the provided one.
Selects the n-th byte from these bytes, starting from 0 for the least significant byte and ending with 3 for the most significant byte.
32-bit SHIFTL (<<) number.shiftl(amount) equivalent to (number << amount)
32-bit SHIFTR (>>) number.shiftr(amount) equivalent to (number >> amount)
Produces a bistring from this integer.
Re-assembles these bytes into an integer.
Turns this signed integer into an unsigned one if it is negative, removing the first (sign) bit
32-bit XOR (^) number.xor32(other) equivalent to (number ^ other)
8-bit XOR (^) NOTE: Assumes both operands are in the range [0, 255] number.xor8(other) equivalent to (number ^ other)