Skip to content

Function: arrayBufferToHex() ​

ts
function arrayBufferToHex(buffer): string;

Defined in: arrayBufferToHex.ts:12

Encodes an ArrayBuffer as a hexadecimal string.

Parameters ​

buffer ​

ArrayBuffer

The ArrayBuffer to encode.

Returns ​

string

The hexadecimal string representation.

Example ​

ts
const data = new Uint8Array([
	160, 86, 74, 247, 96, 194, 217, 75, 150, 16, 199, 174, 112, 213, 217, 112,
])
const result = arrayBufferToHex(data.buffer)

equal(result, 'a0564af760c2d94b9610c7ae70d5d970')

A Streaming Video Technology Alliance project.