Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ebml

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ebml - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

7

example.js

@@ -6,8 +6,5 @@ var ebml = require('./index.js');

decoder.on('Cluster', function(data) {
console.log(data.name, data);
decoder.on('data', function(chunk) {
console.log(chunk);
});
decoder.on('Cluster:end', function(data) {
console.log(data.name + ':end', data);
});

@@ -14,0 +11,0 @@ fs.readFile('media/test.webm', function(err, data) {

@@ -40,3 +40,3 @@ var tools = {

for (var length = 1; length <= 8; length++) {
if (value < Math.pow(2, 7 * length)) {
if (value < Math.pow(2, 7 * length) - 1) {
break;

@@ -43,0 +43,0 @@ }

{
"name": "ebml",
"version": "2.0.0",
"version": "2.1.0",
"description": "ebml parser",

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

@@ -83,3 +83,3 @@ var ebml = require('../lib/ebml/index.js'),

it('should write all 1 byte ints', function() {
for (var i = 0; i < 0x80; i++) {
for (var i = 0; i < 0x80 - 1; i++) {
writeVint(i, new Buffer([i | 0x80]));

@@ -89,27 +89,27 @@ }

it('should write 2 byte int min/max values', function() {
writeVint(Math.pow(2, 7), new Buffer([0x40, 0x80]));
writeVint(Math.pow(2, 14) - 1, new Buffer([0x7F, 0xFF]));
writeVint(Math.pow(2, 7) - 1, new Buffer([0x40, 0x7F]));
writeVint(Math.pow(2, 14) - 2, new Buffer([0x7F, 0xFE]));
});
it('should write 3 byte int min/max values', function() {
writeVint(Math.pow(2, 14), new Buffer([0x20, 0x40, 0x00]));
writeVint(Math.pow(2, 21) - 1, new Buffer([0x3F, 0xFF, 0xFF]));
writeVint(Math.pow(2, 14) - 1, new Buffer([0x20, 0x3F, 0xFF]));
writeVint(Math.pow(2, 21) - 2, new Buffer([0x3F, 0xFF, 0xFE]));
});
it('should write 4 byte int min/max values', function() {
writeVint(Math.pow(2, 21), new Buffer([0x10, 0x20, 0x00, 0x00]));
writeVint(Math.pow(2, 28) - 1, new Buffer([0x1F, 0xFF, 0xFF, 0xFF]));
writeVint(Math.pow(2, 21) - 1, new Buffer([0x10, 0x1F, 0xFF, 0xFF]));
writeVint(Math.pow(2, 28) - 2, new Buffer([0x1F, 0xFF, 0xFF, 0xFE]));
});
it('should write 5 byte int min/max value', function() {
writeVint(Math.pow(2, 28), new Buffer([0x08, 0x10, 0x00, 0x00, 0x00]));
writeVint(Math.pow(2, 35) - 1, new Buffer([0x0F, 0xFF, 0xFF, 0xFF, 0xFF]));
writeVint(Math.pow(2, 28) - 1, new Buffer([0x08, 0x0F, 0xFF, 0xFF, 0xFF]));
writeVint(Math.pow(2, 35) - 2, new Buffer([0x0F, 0xFF, 0xFF, 0xFF, 0xFE]));
});
it('should write 6 byte int min/max value', function() {
writeVint(Math.pow(2, 35), new Buffer([0x04, 0x08, 0x00, 0x00, 0x00, 0x00]));
writeVint(Math.pow(2, 42) - 1, new Buffer([0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]));
writeVint(Math.pow(2, 35) - 1, new Buffer([0x04, 0x07, 0xFF, 0xFF, 0xFF, 0xFF]));
writeVint(Math.pow(2, 42) - 2, new Buffer([0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE]));
});
it('should write 7 byte int min/max value', function() {
writeVint(Math.pow(2, 42), new Buffer([0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00]));
writeVint(Math.pow(2, 49) - 1, new Buffer([0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]));
writeVint(Math.pow(2, 42) - 1, new Buffer([0x02, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]));
writeVint(Math.pow(2, 49) - 2, new Buffer([0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE]));
});
it('should write the correct value for 8 byte int min value', function() {
writeVint(Math.pow(2, 49), new Buffer([0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]));
writeVint(Math.pow(2, 49) - 1, new Buffer([0x01, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]));
});

@@ -116,0 +116,0 @@ it('should write the correct value for the max representable JS number (2^53)', function() {

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