Rockbox mail archiveSubject: Re: clever algorithm string ->int id wanted
Re: clever algorithm string ->int id wanted
Date: Fri, 04 Oct 2002 00:35:00 +0200
On Thu, 3 Oct 2002 16:40:55 -0400, "M. OReilly"
>Would a simple checksum work? A two digit hex checksum would be enough for
>256 unique entries.
Maybe a checksum is not sufficiant to really distinguish two different
strings. BTW I wouldn't be surprised if we exceed a limit of 256
different commands. Well. Somewhen, maybe.
I read in
that they make a hash key for strings with
s*31^(n-1) + s*31^(n-2) + ... + s[n-1]
Because I'm not that much interested in speed while loading a key
scheme I'll take that (in spite of all those multiplications) unless I
accidently stumble across something better.
Received on 2002-10-04