pssh-tools
Advanced tools
Comparing version 1.0.13 to 1.0.14-alpha1
@@ -162,5 +162,8 @@ "use strict"; | ||
exports.encodeKey = (keyPair, keySeed = '') => { | ||
if (keySeed && keySeed.length) { | ||
return generateContentKey(keyPair.kid, keySeed); | ||
} | ||
const kidBuffer = swapEndian(keyPair.kid); | ||
const key = keySeed && keySeed.length ? Buffer.from(generateContentKey(keyPair.kid, keySeed).key, 'base64').toString('hex') : keyPair.key; | ||
const keyBuffer = Buffer.from(key, 'hex'); | ||
// Calculate the checksum with provided key | ||
const keyBuffer = Buffer.from(keyPair.key, 'hex'); | ||
const cipher = crypto.createCipheriv('aes-128-ecb', keyBuffer, '').setAutoPadding(false); | ||
@@ -167,0 +170,0 @@ const checksum = cipher.update(kidBuffer).slice(0, 8).toString('base64'); |
{ | ||
"name": "pssh-tools", | ||
"version": "1.0.13", | ||
"version": "1.0.14-alpha1", | ||
"description": "Tools to generate PSSH Data and PSSH Box", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
597
48354
2