VBA hash string

Maybe others will find this useful. I have collected some different functions to generate a short hash of a string in VBA. I don’t take credit for the code and all sources are referenced. CRC16 Function: =CRC16HASH(A1) with this Code hash is a 4 characters long HEX string 19 code lines 4 digits long hash … Read more

How do I hash a string with Delphi?

If you want an MD5 digest and have the Indy components installed, you can do this: uses SysUtils, IdGlobal, IdHash, IdHashMessageDigest; with TIdHashMessageDigest5.Create do try Result := TIdHash128.AsHex(HashValue(‘Hello, world’)); finally Free; end; Most popular algorithms are supported in the Delphi Cryptography Package: Haval MD4, MD5 RipeMD-128, RipeMD-160 SHA-1, SHA-256, SHA-384, SHA-512, Tiger Update DCPCrypt is … Read more

Python frozenset hashing algorithm / implementation

The problem being solved is that the previous hash algorithm in Lib/sets.py had horrendous performance on datasets that arise in a number of graph algorithms (where nodes are represented as frozensets): # Old-algorithm with bad performance def _compute_hash(self): result = 0 for elt in self: result ^= hash(elt) return result def __hash__(self): if self._hashcode is … Read more

error for hash function of pair of ints

Unfortunately, this program has undefined behavior. C++11 ยง17.6.4.2.1: A program may add a template specialization for any standard library template to namespace std only if the declaration depends on a user-defined type and the specialization meets the standard library requirements for the original template and is not explicitly prohibited. hash<pair<int,int>> depends on primitive and standard … Read more