Base32 Decoding

I had a need for a base32 encoder/decoder, so I spent a couple hours this afternoon throwing this together. I believe it conforms to the standards listed here: https://www.rfc-editor.org/rfc/rfc4648#section-6. public class Base32Encoding { public static byte[] ToBytes(string input) { if (string.IsNullOrEmpty(input)) { throw new ArgumentNullException(“input”); } input = input.TrimEnd(‘=’); //remove padding characters int byteCount = … Read more

Random numbers don’t seem very random

This is similar to the Birthday Problem. Given a group of n people, What is the probability that two share the same birthday1? It’s higher than you’d think. In your case, what are the odds that randomly picking a number between 0 and 1,073,741,823 n times will give you a duplicate? One approximation from the … Read more

tech