无序的字符串集良好的哈希功能?
是否有多个无序字符串集的方法,其中字符串元素相同。 例如:
set1 = [“ AB3567CD”,“ 123”,“ 789012”]
set2 = [“ 789012”,“ AB3567CD”,“ 123”,“ 123”]
set3 = [“ 123”,“ 789012”,“ AB3567CD”]
和哈希这些集合返回相同的结果而无需对其进行排序。
有这样的哈希功能吗?
Is there a method for multiple unordered string sets, in which the string elements are the same.
for example:
set1 = [ "ab3567cd", "123", "789012" ]
set2 = [ "789012", "ab3567cd", "123" ]
set3 = [ "123", "789012", "ab3567cd" ]
And hash these sets return the same result without sorting them.
Is there such a hash function?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果不整理它们的位置,您将始终获得不同的位置。
This are always different strings:
ab3567cd 123 789012
789012 ab3567cd 123
123 ab3567cd 789012
什么是哈希算法?它如何工作?
文件如何工作?
更新:
有两种解决方案,但是如果这是正确的方法,我现在不现在。
这只是一个逻辑示例,
如果我用正确的函数计算集合的值,
。 set1 = [“ ab3567cd”,“ 123”,“ 789012”]
计数:
比哈希相比,result_value的set1,set2,set2和set3始终将获得相同的哈希值。
set1 = [“ AB3567CD”,“ 123”,“ 789012”]
计数:
比HASH result_value始终获得SET1,SET1,SET2和SET3的HASH值。
这个逻辑示例与所有可以哈希的语言一起使用。
Without sorting them to have the same position you will get always different hashes.
This are always different strings:
ab3567cd 123 789012
789012 ab3567cd 123
123 ab3567cd 789012
Do identical strings always have the same SHA-256 value?
What is a Hashing Algorithm and How Does it Work?
How does file hashing works?
UPDATE:
There are two solutions, but i don't now if this is the right way.
This is only an logical example, it maybe not the right function/count way!
If i count the values of the set, with the right function.
set1 = [ "ab3567cd", "123", "789012" ]
count:
Than you hash the RESULT_VALUE you will get always the same hash value for set1, set2 and set3.
set1 = [ "ab3567cd", "123", "789012" ]
Count:
Than you hash the RESULT_VALUE you will get always the same hash value for set1, set2 and set3.
This logical example works with all languages that can hash.