public void Sha3Of224BitsShouldProduceAValidHashResultForTheGivenMessage(string expected, string message) { // Arrange string actual; SHA3 algorithm = SHA3.CreateKeccak224(); // Act actual = ComputeHash(algorithm, message); // Assert Assert.Equal(expected, actual); }
public void Sha3Of224BitsShouldProduceAValidHashResultForTheGivenSequence(string expected, string sequenceString, int sequenceLength) { // Arrange string actual; SHA3 algorithm = SHA3.CreateKeccak224(); // Act actual = ComputeHash(algorithm, string.Concat(Enumerable.Repeat(sequenceString, sequenceLength))); // Assert Assert.Equal(expected, actual); }
public String GetSHA3_Keccak224(Param p) { byte[] h; if (p.Fs != null) { h = SHA3.CreateKeccak224().ComputeHash(p.Fs); } else { h = SHA3.CreateKeccak224().ComputeHash(Settings.GetEncoding().GetBytes(p.ValueToHash)); } return(BitConverter.ToString(h)); }