是否可以创建具有时间到期的哈希?

时间:2021-07-15 18:48:32

标签: time hash md5 data-integrity content-expiration

我想创建一个带有普通输入数据(如字符串和过期时间)的哈希,例如:

伪代码:

key = 'golf';
expiration = 5; //seconds

hash = md5(key, 5); // example.: 312abc3

result = check_hash(hash, key) // => true
// pass five seconds
result = check_hash(hash, key) // => false

有什么办法可以只用哈希值来做到这一点吗?

0 个答案:

没有答案