static toHex(Uint8List bArr) {
int length;
if (bArr == null || (length = bArr.length) <= 0) {
return "";
}
Uint8List cArr = new Uint8List(length << 1);
int i = 0;
for (int i2 = 0; i2 < length; i2++) {
int i3 = i + 1;
var cArr2 = [
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'A',
'B',
'C',
'D',
'E',
'F'
];
var index = (bArr[i2] >> 4) & 15;
cArr[i] = cArr2[index].codeUnitAt(0);
i = i3 + 1;
cArr[i3] = cArr2[bArr[i2] & 15].codeUnitAt(0);
}
return new String.fromCharCodes(cArr);
}
static hex(int c) {
if (c >= '0'.codeUn
Dart Uint8List Hex字符串 互转
最新推荐文章于 2023-12-13 17:13:14 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)