Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: clever algorithm string ->int id wanted

Re: clever algorithm string ->int id wanted

From: <phil_at_x-phobie.de>
Date: Fri, 04 Oct 2002 11:21:34 +0200

On Fri, 4 Oct 2002 07:40:44 +0200 (MET DST), Daniel Stenberg
<daniel_at_haxx.se> wrote:

>On Thu, 3 Oct 2002 phil_at_x-phobie.de wrote:
>
>> I need an algorithm to calculate a unique id from a string, just similar to
>> calculating a hash key.
>
>Since the strings are all known at the time you want to calculate the hashes,
>you can generate a "perfect hash":

>A tool that makes this easier, is gperf:
>
> http://www.gnu.org/software/gperf/gperf.html

Excellent! We should use that during the build process to build a
minimal perfect hash. We'll have to generate sourcefiles for the table
of available commands anyway.

Thanx!

Phil
Received on 2002-10-04

Page template was last modified "Sat Sep 18 20:21:06 2021" The Rockbox Crew -- Privacy Policy