我有一個具體的要求,將字節流轉換爲恰好是每個字符6位的字符編碼。如何將8位字節轉換爲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++)。謝謝!
有人認爲要問相反的問題嗎? – Marine1