New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pssh-tools

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pssh-tools - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

lib/pssh/tools.js

17

lib/pssh/index.js
const widevine = require('./widevine')
const playready = require('./playready')
const tools = require('./tools')
const { system } = require('./utils')
const tools = (systemName) => {
switch (systemName) {
case system.WIDEVINE.name:
return widevine
case system.PLAYREADY.name:
return playready
default:
throw new Error('Unknown drm system')
}
}
module.exports = {
system,
widevine,
playready,
tools
}
const crypto = require('crypto')
const utils = require('./utils')
const utils = require('./tools')

@@ -161,9 +161,4 @@ const DRM_AES_KEYSIZE_128 = 16

const decodePssh = (data) => {
return utils.decodePSSH(data)
}
module.exports = {
encodePssh,
decodePssh
encodePssh
}
const path = require('path')
const protobuf = require('protobufjs')
const utils = require('./utils')
const utils = require('./tools')

@@ -77,9 +77,4 @@ const getPsshData = ({ contentId = null, trackType = '', keyIds = [], provider = '', protectionScheme = 'cenc' }) => {

const decodePssh = (data) => {
return utils.decodePSSH(data)
}
module.exports = {
encodePssh,
decodePssh
encodePssh
}
{
"name": "pssh-tools",
"version": "0.0.9",
"version": "0.0.10",
"description": "Tools to generate PSSH Data and PSSH Box",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -9,7 +9,6 @@ const test = require('ava')

test('Should return Widevine PSSH version 0 without KID', t => {
const wvTools = pssh.tools(pssh.system.WIDEVINE.name)
const payload = { contentId: 'cenc-content-id', trackType: 'HD', provider: 'widevine_test', protectionScheme: 'cenc', dataOnly: false }
const data = wvTools.encodePssh(payload)
const result = wvTools.decodePssh(data)
const data = pssh.widevine.encodePssh(payload)
const result = pssh.tools.decodePssh(data)

@@ -21,7 +20,6 @@ t.is(result.version, 0)

test('Should return Widevine PSSH version 0 with KIDs', t => {
const wvTools = pssh.tools(pssh.system.WIDEVINE.name)
const payload = { contentId: 'cenc-content-id', trackType: 'HD', keyIds: [KID], provider: 'widevine_test', protectionScheme: 'cenc', dataOnly: false }
const data = wvTools.encodePssh(payload)
const result = wvTools.decodePssh(data)
const data = pssh.widevine.encodePssh(payload)
const result = pssh.tools.decodePssh(data)

@@ -35,7 +33,6 @@ console.log(result.printPssh())

test('Should return PlayReady PSSH version 1 with KID', t => {
const prTools = pssh.tools(pssh.system.PLAYREADY.name)
const payload = { keyIds: [KID], licenseUrl: LA_URL, dataOnly: false }
const data = prTools.encodePssh(payload)
const result = prTools.decodePssh(data)
const data = pssh.playready.encodePssh(payload)
const result = pssh.tools.decodePssh(data)

@@ -49,7 +46,6 @@ console.log(result.printPssh())

test('Should return PlayReady PSSH version 1 with Header Version 4.0.0.0 and KID', t => {
const prTools = pssh.tools(pssh.system.PLAYREADY.name)
const payload = { keyIds: [KID], licenseUrl: LA_URL, compatibilityMode: true, dataOnly: false }
const data = prTools.encodePssh(payload)
const result = prTools.decodePssh(data)
const data = pssh.playready.encodePssh(payload)
const result = pssh.tools.decodePssh(data)

@@ -63,5 +59,3 @@ console.log(result.printPssh())

test('Should be able to decode PSSH generated from PSSH-BOX', t => {
const wvTools = pssh.tools(pssh.system.WIDEVINE.name)
const result = wvTools.decodePssh(PSSH_TEST)
const result = pssh.tools.decodePssh(PSSH_TEST)
console.log(result.printPssh())

@@ -68,0 +62,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc