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 taken from the post here. public static int GetRandomInteger(int min = 0, int max = int.MaxValue) 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
Programming

Recursive Object Properties

Recursive Object Properties I’ve been working to create a virtual file system for SQL databases and represent this in a web interface. While creating the classes in .NET I realised that I needed to be able to traverse all the ancestors of a file up to the root level and Read more…

By Shinigami, ago
Programming

List Shuffling

List Shuffling This is just a simple extension for lists to enable the shuffling of items within it based on the StackOverflow answer here. This relies on System.Random so isn’t as random as it could be but is fine for my purposes. public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> source, Random rng) Read more…

By Shinigami, ago