private string ByteArrayToHexString(byte[] arr) { return Regex.Replace(BitConverter.ToString(arr), "[^A-F0-9]", ""); }