我有一个特定的要求,将字节流转换为每个字符恰好是 6 位的字符编码。
Here's an example:
Input: 0x50 0x11 0xa0
Character Table:
010100 T
000001 A
000110 F
100000 SPACE
Output: "TAF "
Logically I can understand how this works:
Taking 0x50 0x11 0xa0 and showing as binary:
01010000 00010001 10100000
Which is "TAF ".
以编程方式执行此操作的最佳方法是什么(伪代码或 C++)。谢谢!