TheDcoder Posted February 11, 2016 Posted February 11, 2016 (edited) Hello Guys! I want to convert the binary hash returned by _Crypt_Hash* function to string. Thanks in Advance! TD Edited February 11, 2016 by TheDcoder Corrected the question EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
Radiance Posted February 11, 2016 Posted February 11, 2016 (edited) ConsoleWrite(StringTrimLeft("0x1B17F2D9AB91B2D6E78C30A0E71F0EB5", 2)) ? Edited February 11, 2016 by Radiance
TheDcoder Posted February 11, 2016 Author Posted February 11, 2016 @Radiance 0x1B17F2D9AB91B2D6E78C30A0E71F0EB5 is currently in integer form... if it was a string it would be easy _Crypt_Hash* functions return hashes in 0x (hexadecimal?) form, I am trying to compare 2 hashes, one in string form and another in integer (0x) form EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
czardas Posted February 11, 2016 Posted February 11, 2016 That's way beyond Int-64, so it is not recognized as an integer type (error). operator64 ArrayWorkshop
TheDcoder Posted February 11, 2016 Author Posted February 11, 2016 @czardas I was not sure about that... I got that error too but _Crypt_Hash* is returning it in integer form Just checked it using VarGetType, it says that it is Binary Sorry everyone, please give me a minute to recollect all my thoughts EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
TheDcoder Posted February 11, 2016 Author Posted February 11, 2016 (edited) Yep, I got a handle in the situation now : Here is what I came up with: #include <Crypt.au3> Local $dHash = _Crypt_HashFile(@ScriptDir & '\test', $CALG_MD5) ConsoleWrite($dHash & @CRLF) ; Binary Form ConsoleWrite(StringTrimLeft(BinaryToString($dHash), 2)) ; This is the MD5 hash in string form TD Edited February 12, 2016 by TheDcoder Corrected Code czardas 1 EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
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