A β-ary to binary conversion for random number generation using a β encoder