One way hash?

This is a discussion on One way hash? within the Java-Games forums in Other Technologies category; 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...

Go Back   Application Development Forum > Other Technologies > Java-Games

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-03-2008, 10:01 PM
newbie
Guest
 
Default One way hash?

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
Reply With Quote
  #2  
Old 07-04-2008, 01:09 AM
Nathan Mates
Guest
 
Default Re: One way hash?

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
Reply With Quote
  #3  
Old 07-04-2008, 01:50 AM
newbie
Guest
 
Default Re: One way hash?

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


Reply With Quote
  #4  
Old 07-04-2008, 07:01 AM
Francis Glassborow
Guest
 
Default Re: One way hash?

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
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 04:06 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.