Skip to content

Instantly share code, notes, and snippets.

@daltonclaybrook
Created July 18, 2014 16:25
Show Gist options
  • Save daltonclaybrook/163b642111ac27aaddd0 to your computer and use it in GitHub Desktop.
Save daltonclaybrook/163b642111ac27aaddd0 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(int argc, const char * argv[])
{
char input[] = { 0xFF, 0x81, 0xBD, 0xA5, 0xA5, 0xBD, 0x81, 0xFF };
for (int i=0; i<8; i++)
{
char hex = input[i];
for (int j=0; j<8; j++)
{
int shift = 7-j;
if (((hex >> shift) & 1) == 1)
{
printf("x");
}
else
{
printf(" ");
}
}
printf("\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment