Sign in to follow this  
Followers 0
JSThePatriot

_Hash($s_ToHash)

1 post in this topic

Below is the code I came up with. I know Hash's arent supposed to be reversable, and this is, but I needed something to encode some items that I dont want just sitting around in plain text. Just meant to keep honest people honest not the bad guys out though I wish I could create something that strong.

Func _Hash($s_ToHash)
    Local $c_Split, $n_Split
    Local $temp, $i, $s_Hash
    
    $s_ToHash = StringStripWS($s_ToHash, 8)
    $c_Split = StringSplit($s_ToHash, "")
    
    For $i = 1 To $c_Split[0]
        $temp = $temp & Asc($c_Split[$i]) * 37 / 25 * 2 / 11 + $c_Split[0]
    Next
    
    For $i = 1 To StringLen($temp) / 3 Step 8
        $s_Hash = $s_Hash & Hex(StringMid($temp, $i, 8), 2)
    Next
    
    If ($s_Hash < 0) Then $s_Hash = -$s_Hash
        
    Return $s_Hash
EndFunc ;==>_Hash

Hope this has a use to someone else besides me.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0