Rockbox mail archiveSubject: clever algorithm string ->int id wanted
clever algorithm string ->int id wanted
Date: Thu, 03 Oct 2002 22:08:48 +0200
I need an algorithm to calculate a unique id from a string, just
similar to calculating a hash key.
The purpose is that for loading key bindings from a file I want the
user to be able to specify the command by name. That in turn would
mean that I had to keep all the names of all commands in the memory.
What a waste of memory. Thus I'd prefer to identify the commands by an
integer id. While loading the key binding file I could calculate an id
from the command name and then search the appropriate command by id.
Received on 2002-10-03