Programming

Upper Case the First Letter of a String

Upper Case the First Letter of a String This is a simple string extension for upper casing the first letter of a string, the code originally came from here. public static class StringExtensions { public static string FirstLetterToUpperCase(this string s) { if (string.IsNullOrEmpty(s)) throw new ArgumentException("There is no first letter"); Read more…

By Shinigami, ago
Programming

Cryptographically Secure Random Number

Cryptographically Secure Random Number In a similar vein to my attempt to generate a cryptographically secure random string I also wanted to be able to create cryptographically secure random numbers. The below function is based on the answer from Markus Olsson to the stackoverflow question here. public static int GetRandomInteger(int Read more…

By Shinigami, ago
Programming

Cryptographically Secure Random String

Cryptographically Secure Random String I’ve been trying to generate unique referal codes composed of uppercase letters for a project and although it’s not really necessary I wanted to make these as cryptographically sound as possible so I could reuse the code later in a personal password generator project. Turns out Read more…

By Shinigami, ago