one quick result: celeste:spin10 mtj$ spin10 -a 0,63 -b 0,63 -bins 32 -rotate ab -set 0,0,0,0 -samples 100000 -trials 10 [000000000] best 5.683527373827505613e+01 8 0 0 0 [000000001] best 5.508690460484671547e+01 8 1 0 0 [000000002] best 5.434519430630660253e+01 8 2 0 0 [000000004] best 5.422007935279938806e+01 8 4 0 0 [000000006] best 5.280780313359068856e+01 8 6 0 0 [000000011] best 5.218225799693001932e+01 8 11 0 0 [000000015] best 5.112439186124714041e+01 8 15 0 0 [000000035] best 4.965170712324208324e+01 8 35 0 0 [000000040] best 4.907791674503666002e+01 8 40 0 0 [000000043] best 4.693620797201791817e+01 8 43 0 0 [000000324] best 4.608481026758963850e+01 13 4 0 0 [000000481] best 4.460801497488986911e+01 15 33 0 0 complete: 3648 trials, 75.095 seconds, 48.578 trials/sec
...says that in one particular test condition (8 character strings, 1M random strings, all possible shift values) and under one particular metric of virtue... x = x<<15 ^ x>>33 ...gives the closest overall approximation to a random result. you might try that in your application to see how well it works for you. that figure of merit (44.608) is not particularly high but not terrible. A modification of FNV1a can get to 22 (almost: 2.200000000000000355e+01) here. On Thu, Feb 7, 2019 at 11:03 AM Serhat Şevki Dinçer <jfcga...@gmail.com> wrote: > On Tuesday, February 5, 2019 at 12:29:32 AM UTC+3, Michael Jones wrote: > >> 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. >> > > yes I am told 15 is not the best shift amount, how about this? > x = x<<27 ^ x>>37 > > the upper limit of length sum could be 9, because hashes of 9-byte valid > utf8 strings are less than 255^9, on average ~247 per uin64 value, so one > such uint64 value most likely will be zero which is the hash of empty > string. so you get a length sum of 9. can you bring it down? or can we > "design" a hash to guarantee 9? > > -- > 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 golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- *Michael T. jonesmichael.jo...@gmail.com <michael.jo...@gmail.com>* -- 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 golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.