tupelo.bits

Tupelo - Making Clojure even sweeter

bit->char

(bit->char bit-val)
Inputs: [bit-val :- s/Int]
Returns: Character

Given an integer bit value 0 or 1, returns a character '0' or '1'

bits-unsigned->byte

(bits-unsigned->byte bits)
Inputs: [bits :- [s/Int]]
Returns: s/Int

Given a vector of 0/1 integer bit values, returns a signed byte value

bits-unsigned->long

(bits-unsigned->long bits)
Inputs: [bits :- [s/Int]]
Returns: s/Int

Given a vector of 0/1 integer bit values, returns a signed long value

byte->bits-unsigned

(byte->bits-unsigned byte-val)
Inputs: [byte-val :- s/Int]
Returns: [s/Int]

Given a positive integer value, returns an 8-len vector of 0/1 integer values

char->bit

(char->bit bit-char)
Inputs: [bit-char :- Character]
Returns: s/Int

Given a character '0' or '1', returns an integer bit value 0 or 1

long->bits-unsigned

(long->bits-unsigned long-val)
Inputs: [long-val :- s/Int]
Returns: [s/Int]

Given a positive integer value, returns a 64-len vector of 0/1 integer values