Kyan Posted April 28, 2015 Share Posted April 28, 2015 How do I write this in autoit?function md5_hmac($data, $key) { if (strlen($key) > 64) $key = pack('H*', md5($key)); $key = str_pad($key, 64, chr(0x00)); $k_ipad = $key ^ str_repeat(chr(0x36), 64); $k_opad = $key ^ str_repeat(chr(0x5c), 64); return md5($k_opad . pack('H*', md5($k_ipad . $data))); }the pack can be done like thisFunc _packH($sInput) Local $sReply = "" For $xx = 1 To StringLen($sInput) Step 2 $sReply &= Chr(Dec(StringMid($sInput, $xx, 2))) Next Return $sReply EndFunc ;==>_packH by Luigistr_pad (don't know if I made some mistake)Func str_pad($input, $PadLenght, $padChr = Chr(0x00)) If Not IsNumber($PadLenght) Then SetError(1) If StringLen($input) < $PadLenght Then Local $out=$input, $c = $PadLenght - StringLen($input) For $qwer = 1 To $c $out &=$padChr Next EndIf Return $out EndFuncstr_repeatFunc str_repeat($input, $multi) If Not IsNumber($multi) Then SetError(1) Local $out = '' For $x = 1 To $multi $out &= $input Next Return $out EndFuncchr 0x36 = 6 ?chr 0x56 = \ ?how can you exp a chr?? WTF Heroes, there is no such thing One day I'll discover what IE.au3 has of special for so many users using it.C'mon there'sĀ InetReadĀ and WinHTTP, way better Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now