Implementation of Perm using Byte arrays for speed/memory size.