Answers for "byte array to hex c#"

C#
3

byte array to hex c#

public static string ByteArrayToString(byte[] ba)
{
  return BitConverter.ToString(ba).Replace("-","");
}
Posted by: Guest on December-16-2020
1

byte array to hex string

public static string ByteArrayToString(byte[] ba)
{
  StringBuilder hex = new StringBuilder(ba.Length * 2);
  foreach (byte b in ba)
    hex.AppendFormat("{0:x2}", b);
  return hex.ToString();
}
Posted by: Guest on August-18-2020

C# Answers by Framework

Browse Popular Code Answers by Language