RbCafe

Hex to number

Posted in Codex by RbCafe on the October 2nd, 2005

Hi 8)

Dim hex as string
Dim num as integer
‘ number 0 to 15 to hex:
hex = mid(”0123456789ABCDEF”, num+1,1)
‘ hex digit to number :
num = instr(”0123456789ABCDEF”,hex)-1

To display a memoryblock in hex, access it one byte at a time, and for each
byte:

Dim byte as integer
Dim hexbyte, hextable as string
hextable = “0123456789ABCDE”
hexbyte = mid(hextable,byte\16 + 1,1) + mid(hextable, byte mod 16 + 1, 1)

And hexbyte back to byte is:

Dim byte as integer
‘byte is 0 to 255
Dim hexbyte, hextable as string
hextable = “0123456789ABCDE”
byte = instr(hextable, left(hexbyte,1))-1
byte = 16*byte + instr(hextable, right(hexbyte,1))-1

Thanks to Erik Winkler

Posted in Cryptix by RbCafe on the October 1st, 2005

Thanks to Erik Winkler for the report of a bug in the version 0.6 of Cryptix

Here you can see interfaces bugs.

Theses bugs will be corrected in the version 0.61 of Cryptix

Thanks for his support :)


Page 28 of 29« First...«2526272829»