public static string HashSCrypt(string input, string salt = null, SCryptOptions options = null) { return(Convert.ToBase64String( HashSCrypt( Encoding.UTF8.GetBytes(input ?? ""), Encoding.UTF8.GetBytes(salt ?? ""), options ) )); }
public static byte[] HashSCrypt(byte[] input, byte[] salt = null, SCryptOptions options = null) { if (input == null) { input = new byte[0]; } if (salt == null) { salt = new byte[0]; } if (options == null) { options = new SCryptOptions(); } var ret = CryptSharp.Utility.SCrypt.ComputeDerivedKey(input, salt, options.Cost, options.BlockSize, options.Parallel, options.MaxThreads, options.DerivedKeyLength); return(ret); }