public static byte[] Hash(byte[] bytes, string algorithm, int bitLength) { switch (algorithm) { case "RIPEMD": return(RIPEMD.Hash(bytes, bitLength)); case "SHA256": return(SHA256.Hash(bytes, bitLength)); case "SHA3": return(SHA3.Hash(bytes, bitLength)); case "BLAKE2s": return(BLAKE2s.Hash(bytes, bitLength)); case "BLAKE2b": return(BLAKE2b.Hash(bytes, bitLength)); default: break; } throw new ArgumentException("Unknown hash algorithm"); }
public static byte[] Hash(byte[] bytes) { return(SHA3.Hash(bytes)); }
public static byte[] Hash(string s) { return(SHA3.Hash(s)); }