Jump to content




Hashing In Lua?


  • You cannot reply to this topic
1 reply to this topic

#1 Mitchfizz05

  • Members
  • 125 posts
  • LocationAdelaide, Australia

Posted 30 August 2013 - 11:04 PM

Hello.
I was wondering if it is possible to hash passwords in lua without sending the password to a server and then the server replying the hashed password.
Also, I've been wanting hashes to make info hashes.

So yeah, any ideas?

#2 GopherAtl

  • Members
  • 888 posts

Posted 31 August 2013 - 07:36 AM

This is what I use, which is adapted from the sha1 routines in tomas1996's StringUtils api. He hasn't updated it in a long time, so I've separated out just the SHA1 routines and rewritten them to use the bit api, which was reimplemented as a java-side api last year, making it is much faster than the original pure lua methods.

http://pastebin.com/5y0L8mWe

source listing:
Spoiler






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users