Skip to content

Instantly share code, notes, and snippets.

@camt
Created January 22, 2012 08:23
Show Gist options
  • Save camt/1656251 to your computer and use it in GitHub Desktop.
Save camt/1656251 to your computer and use it in GitHub Desktop.
algorithm for aesthetically converting bytes to strings
public static string b2s(byte b) {
string result = Convert.ToString(b, 2);
while(result.Length < 8 ) result = "0" + result;
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment