comp.lang.ada
 help / color / mirror / Atom feed
From: Paul Rubin <no.email@nospam.invalid>
Subject: Re: Simple hash or pseudo-random function
Date: Mon, 16 Jul 2018 23:44:12 -0700
Date: 2018-07-16T23:44:12-07:00	[thread overview]
Message-ID: <87o9f6pdj7.fsf@nightsong.com> (raw)
In-Reply-To: 5a66cd8a-e11d-4a59-bce1-8cc693b4160a@googlegroups.com

gautier_niouzes@hotmail.com writes:
> The difficulty for me is to find a very simple function. There are
> many that are for hashing strings, but they could be too
> time-consuming: it's for a number-crunching program where this
> function will be called billions of times, so I'm looking for
> something really simple (and fast :-) ).

String-hashing functions can be very fast, and if you're -really- all
out for speed, there might be machine intrinsics that you could use.
Also you can take the exact characteristics of the input and output
into account when optimizing.

From your description "not uniformily distributed (it's a code with some
meaning)", this may be of interest:

https://en.wikipedia.org/wiki/Zobrist_hashing

      parent reply	other threads:[~2018-07-17  6:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-16  8:20 Simple hash or pseudo-random function gautier_niouzes
2018-07-16 13:34 ` Shark8
2018-07-17  4:44   ` robin.vowels
2018-07-16 14:52 ` Marius Amado-Alves
2018-07-16 20:59   ` gautier_niouzes
2018-07-16 17:17 ` Jeffrey R. Carter
2018-07-16 21:14   ` gautier_niouzes
2018-07-17  6:09     ` Jeffrey R. Carter
2018-07-18 13:38       ` gautier_niouzes
2018-08-01  9:08         ` gautier_niouzes
2018-07-17  0:40 ` Dan'l Miller
2018-07-17  6:44 ` Paul Rubin [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox