Issues

Issue #708 new

Hashes

Lafolie
created an issue

Going out on a limb here, but does anyone feel that it would be advantageous to feature a hashing lib? There is a Lua lib over at http://www.keplerproject.org/md5/ for MD5, and an SHA-2 lib at https://code.google.com/p/sha2/. Something like this is pretty much a requirement for a game that has networked multiplayer with persistance (thus requiring a password or other means of user identification) and is much better handled outside of the Lua context.

Comments (7)

  1. josefnpat

    Now that LOVE comes with LuaJIT, I think that hashing a MD5 or SHA2 would almost be just as fast written in pure Lua.

    Perhaps some benchmarking of a pure c/c++ lib vs LuaJIT w/ pure Lua implementation would provide a better argument of whether or not LOVE would benefit from hash integration.

  2. Bart van Strien

    What kind of hashes would these be anyway? Like file checksums or password hashes? If it's password hashes, I'd rather love not touch that, because it's so easy to do wrong, and fairly out-of-scope too.

  3. Martin Felis

    I would also favour adding some standard hashing functions such as MD5, SHA1 and HMAC (useful for online highscores). There exist PUC Lua 5.1 (i.e. "pure" Lua) implementations for SHA1 and HMAC at http://regex.info/blog/lua/sha1. However as PUC Lua 5.1 does not have a bit library the implementation uses some hacks and might be slow.

    Having these functions on the C side would ensure compatibility with PUC Lua and LuaJIT. Not sure how much of this is an actual goal of LÖVE, though.

  4. Log in to comment