473,406 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Converting String to Byte Array

I'm sure there's got to be an easier way...

What's the best way to convert a String to and from ByteArray for use in
Base64 crypto?

MTIA!!
wardeaux
Nov 20 '05 #1
4 4597
Convert.FromBase64String("THESTRING")

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Wardeaux" <wa******@bellsouth.net> wrote in message
news:OR**************@TK2MSFTNGP12.phx.gbl...
I'm sure there's got to be an easier way...

What's the best way to convert a String to and from ByteArray for use in
Base64 crypto?

MTIA!!
wardeaux

Nov 20 '05 #2
Or other like Convert.To stuff

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:uT*************@TK2MSFTNGP09.phx.gbl...
Convert.FromBase64String("THESTRING")

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
"Wardeaux" <wa******@bellsouth.net> wrote in message
news:OR**************@TK2MSFTNGP12.phx.gbl...
I'm sure there's got to be an easier way...

What's the best way to convert a String to and from ByteArray for use in
Base64 crypto?

MTIA!!
wardeaux


Nov 20 '05 #3
What's the best way to convert a String to and from ByteArray for use in
Base64 crypto?


System.Text.Encoding.UTF8.GetBytes()

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 20 '05 #4
* "Wardeaux" <wa******@bellsouth.net> scripsit:
I'm sure there's got to be an easier way...

What's the best way to convert a String to and from ByteArray for use in
Base64 crypto?


'System.Text.Encoding.*.GetBytes'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: matt melton | last post by:
Hi there, I am trying to write a method that accepts an array of any primitive type and will return the same array without copying memory as an array of bytes. ie. I'd like to be able to do...
4
by: Hal Vaughan | last post by:
If I have a byte and I convert it to string (String sData = new String(byte bData), then convert it back (byte bData = sData.getBytes()), will all data be intact, or do Strings have problems with...
3
by: Pete Davis | last post by:
I've never done this in C# so I don't know what the appropriate way of doing it is. I've got an array of bytes and I need to convert the array into "usable" data. For example, the first 4 bytes...
4
by: Prabhu | last post by:
Hi, We are having problem in converting a byte array to string, The byte array has char(174), char(175), char(240), char(242) and char(247) as delimiters for the message. when we use...
8
by: iyuen | last post by:
I'm having problems with converting a byte array to an image object~ My byte array is an picture in VB6 StdPicture format. I've used propertybag to convert the picture into base64Array format in...
1
by: Benoit | last post by:
Hi, what is the most performing way to convert a byte stream to a string? Byte() to be converted to String. Thanks, iBen. Sorry if it ia a double post in this newsgroup, I cannot set my...
5
by: David | last post by:
I note that you can null teminate a string by adding controlchar.null. Is there a way of adding a null to a Buffer of Bytes and converting it to a string. I have packets coming in from a...
8
by: moondaddy | last post by:
I need to convert a byte array to a string and pass it as a parameter in a URL and then convert it back to the original byte array. However, its getting scrambled in the conversion. In short,...
16
by: manmit.walia | last post by:
Hello All, I have tried multiple online tools to convert an VB6 (bas) file to VB.NET file and no luck. I was hoping that someone could help me covert this. I am new to the .NET world and still...
6
by: ogtheterror | last post by:
Hi I have a very limited understanding of Python and have given this the best shot i have but still have not been able to get it working. Is there anyone that knows how to get this into a .net...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.