Lamer's question #1 - byte array to hexadecimal string

Started by lamer, April 12, 2005, 05:58:00 PM

Previous topic - Next topic

lamer

Hi all!
I am absolutely lamer in assembler, so my question is "lamery" as well.
How can I convert a byte array to hexadecimal string?
In other words, I create hash and want it to appear as "normal" hexadecimal string,not as scribble.
I have found nothing in all FAQs. Any little example or link!.. :(
Thank you in advance.

Vortex

Did you check the dw2hex function from masm32.lib?

Quote
This function was contributed to MASM32 by "f0dder", a student from Silkborg in Denmark.

dw2hex proc source:DWORD, lpBuffer:DWORD

Description
dw2hex converts a DWORD value to an ascii hex string.

Parameters


1. source The DWORD value to convert

   2. lpBuffer The address of the buffer to receive the ascii hex string


Return Value

There is no return value.

Comments

The buffer for the result needs to be 8 bytes long plus one byte for the terminator so for alignment, make the buffer 12 bytes long.