Quantcast
Channel: Convert a hex string to base64 - Stack Overflow
Browsing latest articles
Browse All 4 View Live

Answer by oerkelens for Convert a hex string to base64

You first need to convert your hexstring to a byte-array, which you can then convert to base-64. To convert from your hexstring to Base-64, you can use: public static string HexString2B64String(this...

View Article



Convert a hex string to base64

byte[] ba = Encoding.Default.GetBytes(input); var hexString = BitConverter.ToString(ba); hexString = hexString.Replace("-", ""); Console.WriteLine("Or: " + hexString + " in hexadecimal"); So I got...

View Article

Answer by Meysam Ghorbani for Convert a hex string to base64

public string HexToBase64(string strInput){ try { var bytes = new byte[strInput.Length / 2]; for (var i = 0; i < bytes.Length; i++) { bytes[i] = Convert.ToByte(strInput.Substring(i * 2, 2), 16); }...

View Article

Answer by urpok23 for Convert a hex string to base64

Since .NET5 it can be done using standard library only:string HexStringToBase64String(string hexString){ // hex-string is converted to byte-array byte[] stringBytes =...

View Article
Browsing latest articles
Browse All 4 View Live




Latest Images