SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Releases > Lua

Reply
 
Thread Tools
Bastardized SHA-1 and HMAC-SHA1 Routines in Pure Lua Details »»
Bastardized SHA-1 and HMAC-SHA1 Routines in Pure Lua
Version: , by Flame ("It's ok, I like you too!") Flame is offline
Developer Last Online: Aug 2020

Version: SRB2 Rating: (1 votes - 3.00 average)
Released: 02-04-2020 Last Update: Never Favourites: 0
Scripts Re-Useable Content

Borrowed from this blog post:
http://regex.info/blog/lua/sha1

Updated to fit the constraints of SRB2. - Ie. Bastardized*
This is more of a utility WAD than anything.

Utilize Lua's asserts to verify your sha1 or hmac_sha1 text hashes.
Pass sha1() a string, and it returns a hash as a 40-character hex string. For example, calling the following:
Code:
local hash = sha1("test")
puts the 40-character string into the hash variable
Code:
"ad620dece3f62045f3e0b236220c68b94c935a34"
Pass sha1_hmac() a key and a message, and it returns the signature as a 40-byte hex string.

There are also 2 "*_binary" versions which do the same, but return the 20-byte string of raw data that the 40-byte hex strings represent.

DISCLAIMER:
* This is a bastardized version of SHA-1 and HMAC-SHA1 routines. Meaning that these SHA1 and HMAC-SHA1 routines are only compatible with checking hashes within SRB2 itself. Actual SHA1 and HMAC-SHA1 routines will give different results.
With the the lack of math.modf Library, measurements are done with the FRACUNIT (65536) unit of measurement instead.

Download Now

File Type: zip VL_sha1-v1.zip (37.6 KB, 78 views)

Supporters / CoAuthors

Show Your Support

  • The author of this addon has given explicit permission for its content to be re-used and/or reproduced.

Comments
Old 02-07-2020   #2
TehRealSalt
(σᴥσ)
Judge
 
TehRealSalt's Avatar
Default

Welcome to releases
__________________
Twitter | Not really around here anymore, working on my indie game over at Patreon
TehRealSalt is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:39 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.