[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Hash calculation
- From: "Mark Edgar" <medgar123@...>
- Date: Tue, 8 May 2007 18:43:59 -0700
On 5/8/07, Neha <email@example.com> wrote:
I need to calculate hash of a string in lua.
How would I do this?
Why do you need to compute the hash of a string in Lua? Lua's table
already provides a hash data structure.
Assuming that you don't want a hash data structure, you might be
asking about a cryptographic hash function, or message digest. In
this case, there exist several MD5 implementations in Lua, as well as
a binding to the OpenSSL library in LuaCrypto.
If you don't want a cryptographic hash, then what kind of hash do you
want? I dare say that there are as many hash functions for strings as
there pebbles on a beach. Well, not quite that many I guess. Anyway,
check the links from the Wikipedia page:
and of course, Lua hashes strings too: