convert byte array to hex string python code example
Example 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();
}
Example 2: bytearray to hex python
''.join('{:02x}'.format(x) for x in StringToBeConverted)