Alright added SHA-1 and Base64 encode and decoding. Also I've added "init" calls to prevent the need for continually creating new objects by allowing hash object reuse.
Code:require('bit') local md5 = bit.newMD5() md5:init() md5:update("The quick brown fox ") md5:update("jumps over the lazy dog.") print(md5:final()) local sha1 = bit.newSHA1() sha1:init() sha1:update("The quick brown fox jumps over the lazy dog") print(sha1:final()) local str = "The quick brown fox jumps over the lazy dog" local es= bit.base64encode(str) print(es) local ds = bit.base64decode(es) print(ds)


Reply With Quote