Compress 21 Alphanumeric Characters in to 16 Bytes

后端 未结 8 723
耶瑟儿~
耶瑟儿~ 2020-12-16 15:07

I\'m trying to take 21 bytes of data which uniquely identifies a trade and store it in a 16 byte char array. I\'m having trouble coming up with the right algor

8条回答
  •  南笙
    南笙 (楼主)
    2020-12-16 15:36

    If it can only contain letters, then you have less than 64 possibilities per character (26 upper case, 26 lower case, leaving you 12 for space, terminator, underscore, etc). With 6 bits per character, you should get there - in 15 characters. Assuming you don't support special characters.

提交回复
热议问题