Jump to content

Convert Binary Hash returned by _Crypt to String


 Share

Recommended Posts

Hello Guys! :D

I want to convert the binary hash returned by _Crypt_Hash* function to string.

Thanks in Advance! TD :D

Edited 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

Link to comment
Share on other sites

@Radiance 0x1B17F2D9AB91B2D6E78C30A0E71F0EB5 is currently in integer form... if it was a string it would be easy :P

 

_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

Link to comment
Share on other sites

@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 :blink:

 

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

Link to comment
Share on other sites

Yep, I got a handle in the situation now :D:

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 by TheDcoder
Corrected Code

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

Link to comment
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
 Share

×
×
  • Create New...