Created
May 7, 2020 13:14
-
-
Save ryangraham/2e412e61b7a90ec6e90947d599fc54b5 to your computer and use it in GitHub Desktop.
track2_decode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // track2 decode | |
| std::string decoded = ""; | |
| uint8_t left = 0; | |
| uint8_t right = 0; | |
| for (uint8_t c : encoded) | |
| { | |
| left = c >> 4; | |
| right = c & 0b00001111; | |
| decoded.append(1, left + 0x30); | |
| decoded.append(1, right + 0x30); | |
| } | |
| std::cout << decoded << std::endl; | |
| // Output: ;4088490010739415=24082260007000?3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment