This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class FastFactorial | |
{ | |
public static BigInteger Factorial(BigInteger n) | |
{ | |
return MultiplyRange(2, n); | |
} | |
private static BigInteger MultiplyRange(BigInteger from, BigInteger to) | |
{ | |
var diff = to - from; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Requires the BCrypt nuget package. Available here: https://www.nuget.org/packages/BCrypt.Net-Next | |
/// </summary> | |
public static class PasswordHashing | |
{ | |
public static string HashPassword(string password, int workFactor) | |
{ | |
return BCrypt.Net.BCrypt.HashPassword(password, workFactor); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class GenericArithmeticFactory<T> | |
{ | |
private static Dictionary<ExpressionType, Func<T, T, T>> _binaryOperationDictionary; | |
private static Dictionary<ExpressionType, Func<T, T, bool>> _comparisonOperationDictionary; | |
private static Func<T, T> _sqrtOperation = null; | |
static GenericArithmeticFactory() | |
{ | |
_binaryOperationDictionary = new Dictionary<ExpressionType, Func<T, T, T>>(); | |
_comparisonOperationDictionary = new Dictionary<ExpressionType, Func<T, T, bool>>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Collections; | |
using System.ComponentModel; | |
using System.Collections.Generic; | |
using System.Collections.Specialized; | |
using System.Collections.ObjectModel; | |
using System.Runtime.CompilerServices; | |
OlderNewer