Function: toBigEndianKeyId()
ts
function toBigEndianKeyId(keyId): ArrayBuffer;Defined in: playready/toBigEndianKeyId.ts:12
Converts a 16-byte key ID from little-endian to big-endian format.
Parameters
keyId
The little-endian key ID to convert.
Returns
The big-endian representation of the key ID.
Example
ts
const littleEndianKeyId = 'a0564af7-60c2-d94b-9610-c7ae70d5d970'
const expectedBigEndianKeyId = 'f74a56a0-c260-4bd9-9610-c7ae70d5d970'
const inputBuffer = uuidToArrayBuffer(littleEndianKeyId)
const result = toBigEndianKeyId(inputBuffer)
const resultHex = arrayBufferToUuid(result)
equal(resultHex, expectedBigEndianKeyId)