7 lines
173 B
JavaScript
7 lines
173 B
JavaScript
// ------------------------------
|
|
export default function bin2hex(n){
|
|
const a = new Uint8Array(n)
|
|
return Array.from(a).map(v=>v.toString(16).padStart(2,'0')).join('')
|
|
}
|
|
|