Branch: Tag:

2016-06-24

2016-06-24 09:49:17 by Per Hedbor <ph@opera.com>

Renamed 'hash' to 'hash_7_8'

Hopefully it will not be used now (this is triggered by yet another
person thinking it's a good string hashing function).

The function is not really suitable for use. The returned values are
higly likely to be the same for similar strings, something that is not
optimal for hashing.

Also added comments about what to use instead (hash_value or one of
the cryptographic hash functions).

It might make sense to add a hash() that actually works, perhaps
siphash?

464:    "gluRenderMode": "predef::GLU.gluPickMatrix":1,    "grantpt()": "7.8::Stdio.File.openpt":1,    "handle_alert()": "predef::SSL.Connection.got_data":1, +  "hash()": "predef::hash_7_0":1, +  "hash_7_6()": "predef::hash_7_4":1,    "headers": "predef::Protocols.WebSocket.Connection.connect":1, "predef::Stdio.sendfile":2,    "hello_request": "predef::SSL.ServerConnection.send_renegotiate":1,    "how->owner": "predef::Fuse.Operations.lock":1,
480:    "layers": "predef::Image.Layer":1,    "ldapfd": "predef::Protocols.LDAP.protocol.error_number":1,    "len": "predef::Stdio.sendfile":2, -  "lfun::_hash()": "predef::ADT.CritBit.FloatTree.encode_key":1, "predef::ADT.CritBit.IPv4Tree.encode_key":1, "predef::ADT.CritBit.IntTree.encode_key":1, "predef::ADT.CritBit.StringTree.encode_key":1, +  "lfun::_hash()": "predef::ADT.CritBit.FloatTree.encode_key":1, "predef::ADT.CritBit.IPv4Tree.encode_key":1, "predef::ADT.CritBit.IntTree.encode_key":1, "predef::ADT.CritBit.StringTree.encode_key":1, "predef::hash_7_8":1,    "low_big_query()": "predef::__builtin.Sql.Connection.streaming_query":2,    "low_big_typed_query()": "predef::__builtin.Sql.Connection.streaming_typed_query":1,    "m": "predef::Filesystem.Monitor.basic.Monitor.check":1,
503:    "pid": "predef::Fuse.Operations.lock":1,    "predef::__pragma_save_parent__": "cpp::":1,    "predef::foreach()": "lfun::_get_iterator":1, +  "predef::hash": "lfun::__hash":1,    "prev": "predef::Parser.RCS.Revision":2,    "programof()": "predef::Encoder.nameof":1,    "query_address": "7.8::Stdio.File.set_read_callback":1, "predef::NetUtils.ip_of":1, "predef::NetUtils.port_of":1,
618:   "8.0::Tools.X509.rsa_verifier": "Verifier"   "8.0::Tools.X509.verify_certificate_chain": "Standards.ASN1.Sequence"   "cpp::": "7.2::dirname()" "Debug.assembler_debug()" "_Static_assert" "cpp()" "dirname()" "predef::__pragma_save_parent__" + "lfun::__hash": "predef::hash"   "lfun::_deserialize": "Serialization.deserialize()" "Serializer.Serializable" "Serializer.Serializable()->_deserialize()" "Serializer.deserialize()"   "lfun::_get_iterator": "predef::foreach()"   "lfun::_random": "RandomInterface" "RandomInterface()->random" "RandomInterface()->random_string"
1561:   "predef::gethrvtime": "gauge" "gauge()"   "predef::getpwnam": "getpwent()"   "predef::getpwuid": "getpwent()" + "predef::hash_7_0": "hash()" + "predef::hash_7_4": "hash_7_6()" + "predef::hash_7_8": "lfun::_hash()"   "predef::map": "foreach()"   "predef::rm": "EISDIR" "ENOTDIR"   "predef::throw": "catch" "master()->handle_error()"