By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,326 Members | 838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,326 IT Pros & Developers. It's quick & easy.

Data Conversion

P: n/a
I've been brute forcing a conversion of binary data in a byte array into
ASCII encrypted hex (2 chars = 1 byte). Is there a formatting scheme that
will allow me to do this? Here's a snipet of the code I've been using:

For Count = 0 To myBuffer.Ubound(0)

If Len(Hex(myBuffer(Count))) < 2 Then

ByteValue = "0" & Hex(myBuffer(Count))

Else

ByteValue = Hex(ReadBuffer(Count))

End If

DisplayString.Append(ByteValue)

Next Count
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Brad Markisohn" <db*********@indesign-llc.com> schrieb
I've been brute forcing a conversion of binary data in a byte array
into ASCII encrypted hex (2 chars = 1 byte). Is there a formatting
scheme that will allow me to do this? Here's a snipet of the code
Formatting scheme?
I've been using:

For Count = 0 To myBuffer.Ubound(0)

If Len(Hex(myBuffer(Count))) < 2 Then

ByteValue = "0" & Hex(myBuffer(Count))

Else

ByteValue = Hex(ReadBuffer(Count))

End If

DisplayString.Append(ByteValue)

Next Count


I would write:

For Count = 0 To myBuffer.Ubound(0)
DisplayString.Append(myBuffer(Count).ToString("X2" )
Next Count

Does this help?
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

P: n/a
Hi Brad,

Thanks for posting in the community.

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Nov 20 '05 #3

P: n/a
Hi Brad,

Thanks for posting in the community.

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you want to convert a byte array
into a string, where each byte will be convert into two chars.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

I agree with Armin's suggestion. Also what do you mean by the "Formatting
scheme", if you have any concern on this issue ,please post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.