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}"); }
private bool ValidateHash(long expiry, string salt, string originalHash) => ExpiringUrl.CreateHash(expiry, salt) == originalHash;