Your VB output doesn't correctly pad the hex digits for values smaller than 16; the byte 0x02 is represented as just 2
, not 02
, and the 0x0E byte is included as e
, not 0e
.
You need to add a .PadLeft()
call:
api_sig = api_sig + Hex(hashValue(i)).PadLeft(2, "0"c)
or use string formatting:
api_sig = api_sig + String.Format("{0:X2}", hashValue(i))