Exemple #1
0
        public string Create(string url, string salt, int timeToLiveInMinutes = 5)
        {
            var expires = DateTime.Now.AddMinutes(timeToLiveInMinutes).Ticks;
            var hash    = ExpiringUrl.CreateHash(expires, salt);

            return($"{url}?{Constants.ExpiresParam}={expires}&{Constants.HashParam}={hash}");
        }
Exemple #2
0
 private bool ValidateHash(long expiry, string salt, string originalHash) => ExpiringUrl.CreateHash(expiry, salt) == originalHash;