Skip to content

Instantly share code, notes, and snippets.

@ryangraham
Created May 7, 2020 13:14
Show Gist options
  • Save ryangraham/2e412e61b7a90ec6e90947d599fc54b5 to your computer and use it in GitHub Desktop.
Save ryangraham/2e412e61b7a90ec6e90947d599fc54b5 to your computer and use it in GitHub Desktop.
track2_decode
// 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