散列和散列? [英] Hash and Unhash?
问题描述
是否可以在Java中使用bcrypt进行哈希处理,然后再次对其进行哈希处理?可能吗?我正在尝试一些新的东西,但是我对Unhashing一无所知(如果可能的话).有人可以给我一个例子吗?
Is it possible to Hash using bcrypt in java and again unhash it? Is it even possible? I was trying something new but I do not know anything about Unhashing (if it's possible). Can someone give me an example of somekind if it's possible?
如果知道密钥,是否存在可逆的哈希算法?
Is there a hashing algorithm which is reversible if the key is known?
推荐答案
如果您正在讨论覆盖hashCode(),则如果您的对象可以具有2 ^ 32个以上的状态,则无法进行任何可逆的哈希.仅有2 ^ 32个可能的哈希值(因为hashCode()返回int),因此只能表示2 ^ 32个不同的状态.
If you're talking about overriding hashCode(), if your object can have more than 2^32 states then it's impossible to make any reversible hash. There are only 2^32 possible hash values (because hashCode() returns int), so only 2^32 different states can be represented.
这篇关于散列和散列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!