Пример #1
0
        string GenerateHash()
        {
            var messageString = string.Join(string.Empty, Message);
            var message       = Melody + messageString + Time;
            var hasher        = new DrinksSipHasher();

            return(hasher.CalculateHash(message, ConfigurationFacade.LocalHashKey));
        }
Пример #2
0
        string GenerateHash()
        {
            var productsString = string.Join(string.Empty, Products);
            var message        = Header + productsString + Time;
            var hasher         = new DrinksSipHasher();

            return(hasher.CalculateHash(message, ConfigurationFacade.LocalHashKey));
        }
Пример #3
0
        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();
            }
        }