| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| I think what I need is a one-way hash, but I am not sure? I need to "convert" a string into a "unique" integer (or very low risk of collision, it doesn't have to be perfect), in a C-like language that does not have pointers! First, is what I am looking for called a one-way hash? Second, does anyone have an algorithm for doing such a thing? (... and no, this isn't homework )TIA multiposted at: alt.comp.lang.learn.c-c++ comp.games.development.programming.algorithms |
|
#2
| |||
| |||
| In article <486d848f$0$3098$5a62ac22@per-qv1-newsreader-01.iinet.net.au>, newbie <IDontWantAnyEmail@NoSpam.com> wrote: >I need to "convert" a string into a "unique" integer (or very low risk >of collision, it doesn't have to be perfect), in a C-like language that >does not have pointers! CRC32 or FNV-1 work well. FNV-1 might be a better choice, as it doesn't use table lookups or the like. Nathan Mates -- <*> Nathan Mates - personal webpage http://www.visi.com/~nathan/ # Programmer at Pandemic Studios -- http://www.pandemicstudios.com/ # NOT speaking for Pandemic Studios. "Care not what the neighbors # think. What are the facts, and to how many decimal places?" -R.A. Heinlein |
|
#3
| |||
| |||
| Thanks for the responses... All I needed was to change text to a "unique" integer, so I have found the JenkinsHash at wikipedia to serve my needs... for now ![]() |
|
#4
| |||
| |||
| newbie wrote: > I think what I need is a one-way hash, but I am not sure? > > I need to "convert" a string into a "unique" integer (or very low risk > of collision, it doesn't have to be perfect), in a C-like language that > does not have pointers! In that case post to a newsgroup supporting your language. Sorry, but however much you think it is C like, if it does not have pointers it is very different from C. > > First, is what I am looking for called a one-way hash? > Second, does anyone have an algorithm for doing such a thing? > > (... and no, this isn't homework )Algorithms is a different newsgroup. Francis |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.