在iOS(不是OS X)版本中具有相同值的NSString散列? [英] NSString hash with same value across releases of iOS (not OS X)?
问题描述
NSString hash
的文档(甚至是 iOS文档)包含以下指令:
不应该依赖这个属性在
版本的OS X中具有相同的散列值。
我们知道该属性是否可以假设在iOS版本(而不是OS X)上具有相同的值?
我们知道为什么它可能会OS X有所不同吗? (例如,是否允许Apple在某个时刻从MD5切换到另一个哈希函数?)
我们可以不依赖于NSString哈希。看看:
http://www.abakia.de/blog/2012/12/05/nsstring-hash-is-bad/
The documentation for NSString hash
(even the iOS documentation) contains this instruction:
You should not rely on this property having the same hash value across releases of OS X.
Do we know whether the property can be assumed to have the same value across releases of iOS (as opposed to OS X)?
And do we know why it may vary for OS X? (Is this e.g. for allowing Apple to switch from, say, MD5 to another hash function at some point?)
We can not rely on NSString hash. Take a look at :
Why is [NSString hash] device dependent?
http://www.abakia.de/blog/2012/12/05/nsstring-hash-is-bad/
这篇关于在iOS(不是OS X)版本中具有相同值的NSString散列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!