예제 #1
0
        public Product ProductFromHash(string hash)
        {
            var json    = StringCompression.Decompress(hash);
            var product = JsonConvert.DeserializeObject <Product>(json);

            return(product);
        }
예제 #2
0
        public string CreateHash(string productName, string ingredients)
        {
            var product = new Product(productName, ingredients);
            var json    = JsonConvert.SerializeObject(product);
            var hash    = StringCompression.Compress(json);

            return(hash);
        }