Skip to content

Instantly share code, notes, and snippets.

@wadewegner
Created August 20, 2012 14:40
Show Gist options
  • Save wadewegner/3404785 to your computer and use it in GitHub Desktop.
Save wadewegner/3404785 to your computer and use it in GitHub Desktop.
Create a base 64 encoded sequence of 256 bits
byte[] b = new byte[32];
RandomNumberGenerator randomNumberGenerator = RandomNumberGenerator.Create();
randomNumberGenerator.GetBytes(b);
string result = Convert.ToBase64String(b);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment