NSString hash with same value across releases of iOS (not OS X)?

*爱你&永不变心* 提交于 2019-12-11 23:49:51

问题


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?)


回答1:


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/



来源:https://stackoverflow.com/questions/28301891/nsstring-hash-with-same-value-across-releases-of-ios-not-os-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!