通过 Buffer.from(array, 'hex') 得到值b后,怎么反向从b 得到 array数组
发布于 5 年前 作者 345632828 4159 次浏览 来自 问答

代码如下 let a = [-74, -82, -6, -30, 127, -102, 42, -46, 4, -87, 64, 105, 26, -7, 109, -126, 94, -84, 32, -19, -42, -31, 96, -111, 117, -87, -47]

let b = Buffer.from(a, ‘hex’)

console.log(‘a to hex’,b)

得到值 b 后,怎么通过b值得到 a数组啊?

请大侠帮忙

5 回复

@waitingsong 非常感谢大侠帮忙 : )

@waitingsong 数组里的元素最大值超过128呢

UInt8Array, Int32Array, UInt32Array, Float64Array 挑一个

回到顶部