Specials
Top sellers

Hash and HMAC generator.

Hash and HMAC generator.
Product Code: SD_Hash
Availability: In Stock
Built for: Any platform
Product Version: 1
Req. ShiVa Version: ShiVa 1.9.2 Editor
Price: FREE $0
Seller information: Silicon Droid
Country: Spain
Company: Silicon Droid
Qty:     - OR -   Wish List
Compare

--------------------------------------------------------------------------------
HASHING: SHA256 SHA512 HMAC256 HMAC512
--------------------------------------------------------------------------------

SD_Hash performs hash calculations using string manipulations to perform bitwise operations on strings of 1s and 0s. This means it exists in pure stonescript and so it can be built for any platform. It works asynchronously, you call it and then it performs one hash round per frame until finished and then it calls you back with the result. It's slow, taking some seconds to complete, but it wont drop your game FPS and so it's ideal for the odd occasion when you want a single hash calc. 

The script is C++ compliant, you may generate c++ code from it and it will compile cleanly, thus you can speed it up considerably if so required.


SIMPLE USE EXAMPLE:

[1] Import the SD_Hash.ste file into the ShiVa editor.
[2] Include the SD_Hash ai in your games "Main" ai list.
[3] Then call it as needed. You can queue calls up, the AI will process the queue one hash at a time until the queue is empty.
 

A simple use example follows:

--------------------------------------------------------------------------------
function AI_Main.onInit ( )
--------------------------------------------------------------------------------

local sStringToHash = "HELLO WORLD"

-- PERFORM A SHA256 HASH
user.sendEvent ( application.getCurrentUser ( ), "SD_Hash", "onHASH_Do", "SHA256", sStringToHash, nil, "AI_Main", "onHASH_Done" )

-- PERFORM A SHA512 HASH
user.sendEvent ( application.getCurrentUser ( ), "SD_Hash", "onHASH_Do", "SHA512", sStringToHash, nil, "AI_Main", "onHASH_Done" )

-- PERFORM A SHA256 HMAC
user.sendEvent ( application.getCurrentUser ( ), "SD_Hash", "onHMAC_Do", "SHA256", sStringToHash, nil, "AI_Main", "onHASH_Done" )

-- PERFORM A SHA512 HMAC
user.sendEvent ( application.getCurrentUser ( ), "SD_Hash", "onHMAC_Do", "SHA512", sStringToHash, nil, "AI_Main", "onHASH_Done" )

log.message ( "HASHING: ", sStringToHash, " ..." )

--------------------------------------------------------------------------------
end
--------------------------------------------------------------------------------
 

You need to implement callback/s to listen for the result/s, like:

--------------------------------------------------------------------------------
function AI_Main.onHASH_Done ( sHex, sBase64 )
--------------------------------------------------------------------------------

log.message ( "HEX = ", sHex )
log.message ( "B64 = ", sBase64 )

--------------------------------------------------------------------------------
end
--------------------------------------------------------------------------------

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



Tags: hash, sha, hmac
ShiVa Store © 2017 - Powered By OpenCart