There are many measures. One realm of them focus on the mixing properties of the design as would be a consideration in cypher systems. The other “experimentalist” realm considers how the hash performs compared to an ideal hash function.
The latter approach is suitable for a broader range of developers. A google search for measuring hash quality will quickly lead to expectations about collisions from a random variable and also to equations for statistical measures. I recently did just this in an effort (successful!) to make a well-known simple hash function be its best with minor single CPU cycle changes. On Mon, Feb 4, 2019 at 11:49 AM Serhat Şevki Dinçer <[email protected]> wrote: > Hi, > > What is the minimum sum of input lengths len(s1)+len(s2) such that: > > - s1, s2 are distinct utf8 strings > - Txt2int(s1) = Txt2int(s2) > > for the below simple hash function ? > > func Txt2int(s string) uint64 { > x := uint64(len(s)) > for i := len(s) - 1; i >= 0; i-- { > x = x<<15 ^ x>>49 > x += uint64(s[i]) > } > return x > } > > In general, how good is "minimum sum of colliding input lengths" as a > measure of collision-resistance for a (not necessarily cryptographic) hash > function ? > > Thanks.. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- *Michael T. [email protected] <[email protected]>* -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
