Byte, Hex, Base64 manipulation in pure javascript