string GenerateHash() { var messageString = string.Join(string.Empty, Message); var message = Melody + messageString + Time; var hasher = new DrinksSipHasher(); return(hasher.CalculateHash(message, ConfigurationFacade.LocalHashKey)); }
string GenerateHash() { var productsString = string.Join(string.Empty, Products); var message = Header + productsString + Time; var hasher = new DrinksSipHasher(); return(hasher.CalculateHash(message, ConfigurationFacade.LocalHashKey)); }
void ValidateHash(string littleEndianKey) { var message = Badge + Product + Time; var hasher = new DrinksSipHasher(); var hash = hasher.CalculateHash(message, littleEndianKey); if (!hash.Equals(Hash, StringComparison.InvariantCultureIgnoreCase)) { throw new InvalidHashException(); } }