Socket
Socket
Sign inDemoInstall

pkcs7

Package Overview
Dependencies
0
Maintainers
42
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.3 to 1.0.0

bin/cli.js

118

dist/pkcs7.js

@@ -1,2 +0,7 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.pkcs7=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.pkcs7 = global.pkcs7 || {})));
}(this, (function (exports) { 'use strict';
/*

@@ -10,6 +15,4 @@ * pkcs7.pad

'use strict';
var PADDING = void 0;
var PADDING;
/**

@@ -21,94 +24,15 @@ * Returns a new Uint8Array that is padded with PKCS#7 padding.

*/
module.exports = function pad(plaintext) {
var padding = PADDING[(plaintext.byteLength % 16) || 0],
result = new Uint8Array(plaintext.byteLength + padding.length);
function pad(plaintext) {
var padding = PADDING[plaintext.byteLength % 16 || 0];
var result = new Uint8Array(plaintext.byteLength + padding.length);
result.set(plaintext);
result.set(padding, plaintext.byteLength);
return result;
};
}
// pre-define the padding values
PADDING = [
[16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16],
PADDING = [[16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16], [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15], [14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14], [13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11], [10, 10, 10, 10, 10, 10, 10, 10, 10, 10], [9, 9, 9, 9, 9, 9, 9, 9, 9], [8, 8, 8, 8, 8, 8, 8, 8], [7, 7, 7, 7, 7, 7, 7], [6, 6, 6, 6, 6, 6], [5, 5, 5, 5, 5], [4, 4, 4, 4], [3, 3, 3], [2, 2], [1]];
[15, 15, 15, 15,
15, 15, 15, 15,
15, 15, 15, 15,
15, 15, 15],
[14, 14, 14, 14,
14, 14, 14, 14,
14, 14, 14, 14,
14, 14],
[13, 13, 13, 13,
13, 13, 13, 13,
13, 13, 13, 13,
13],
[12, 12, 12, 12,
12, 12, 12, 12,
12, 12, 12, 12],
[11, 11, 11, 11,
11, 11, 11, 11,
11, 11, 11],
[10, 10, 10, 10,
10, 10, 10, 10,
10, 10],
[9, 9, 9, 9,
9, 9, 9, 9,
9],
[8, 8, 8, 8,
8, 8, 8, 8],
[7, 7, 7, 7,
7, 7, 7],
[6, 6, 6, 6,
6, 6],
[5, 5, 5, 5,
5],
[4, 4, 4, 4],
[3, 3, 3],
[2, 2],
[1]
];
},{}],2:[function(_dereq_,module,exports){
/*
* pkcs7
* https://github.com/brightcove/pkcs7
*
* Copyright (c) 2014 Brightcove
* Licensed under the apache2 license.
*/
'use strict';
exports.pad = _dereq_('./pad.js');
exports.unpad = _dereq_('./unpad.js');
},{"./pad.js":1,"./unpad.js":3}],3:[function(_dereq_,module,exports){
/*
* pkcs7.unpad
* https://github.com/brightcove/pkcs7
*
* Copyright (c) 2014 Brightcove
* Licensed under the apache2 license.
*/
'use strict';
/**

@@ -120,8 +44,12 @@ * Returns the subarray of a Uint8Array without PKCS#7 padding.

*/
module.exports = function unpad(padded) {
function unpad(padded) {
return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);
};
}
},{}]},{},[2])
(2)
});
var version = "1.0.0";
exports.pad = pad;
exports.unpad = unpad;
exports.VERSION = version;
})));

@@ -1,2 +0,7 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),(f.pkcs7||(f.pkcs7={})).pad=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.pkcs7 = global.pkcs7 || {}, global.pkcs7.pad = factory());
}(this, (function () { 'use strict';
/*

@@ -10,6 +15,4 @@ * pkcs7.pad

'use strict';
var PADDING = void 0;
var PADDING;
/**

@@ -21,71 +24,17 @@ * Returns a new Uint8Array that is padded with PKCS#7 padding.

*/
module.exports = function pad(plaintext) {
var padding = PADDING[(plaintext.byteLength % 16) || 0],
result = new Uint8Array(plaintext.byteLength + padding.length);
function pad(plaintext) {
var padding = PADDING[plaintext.byteLength % 16 || 0];
var result = new Uint8Array(plaintext.byteLength + padding.length);
result.set(plaintext);
result.set(padding, plaintext.byteLength);
return result;
};
}
// pre-define the padding values
PADDING = [
[16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16],
PADDING = [[16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16], [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15], [14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14], [13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11], [10, 10, 10, 10, 10, 10, 10, 10, 10, 10], [9, 9, 9, 9, 9, 9, 9, 9, 9], [8, 8, 8, 8, 8, 8, 8, 8], [7, 7, 7, 7, 7, 7, 7], [6, 6, 6, 6, 6, 6], [5, 5, 5, 5, 5], [4, 4, 4, 4], [3, 3, 3], [2, 2], [1]];
[15, 15, 15, 15,
15, 15, 15, 15,
15, 15, 15, 15,
15, 15, 15],
return pad;
[14, 14, 14, 14,
14, 14, 14, 14,
14, 14, 14, 14,
14, 14],
[13, 13, 13, 13,
13, 13, 13, 13,
13, 13, 13, 13,
13],
[12, 12, 12, 12,
12, 12, 12, 12,
12, 12, 12, 12],
[11, 11, 11, 11,
11, 11, 11, 11,
11, 11, 11],
[10, 10, 10, 10,
10, 10, 10, 10,
10, 10],
[9, 9, 9, 9,
9, 9, 9, 9,
9],
[8, 8, 8, 8,
8, 8, 8, 8],
[7, 7, 7, 7,
7, 7, 7],
[6, 6, 6, 6,
6, 6],
[5, 5, 5, 5,
5],
[4, 4, 4, 4],
[3, 3, 3],
[2, 2],
[1]
];
},{}]},{},[1])
(1)
});
})));

@@ -1,19 +0,7 @@

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (global){
global.window.pkcs7 = {
unpad: require('./unpad')
};
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.pkcs7 = global.pkcs7 || {}, global.pkcs7.unpad = factory());
}(this, (function () { 'use strict';
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./unpad":2}],2:[function(require,module,exports){
/*
* pkcs7.unpad
* https://github.com/brightcove/pkcs7
*
* Copyright (c) 2014 Brightcove
* Licensed under the apache2 license.
*/
'use strict';
/**

@@ -25,6 +13,8 @@ * Returns the subarray of a Uint8Array without PKCS#7 padding.

*/
module.exports = function unpad(padded) {
function unpad(padded) {
return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);
};
}
},{}]},{},[1]);
return unpad;
})));
{
"name": "pkcs7",
"version": "0.2.3",
"version": "1.0.0",
"main": "lib/pkcs7.js",

@@ -21,3 +21,4 @@ "description": "Add and remove pkcs7-style padding.",

"files": [
"lib",
"bin",
"src",
"dist"

@@ -30,16 +31,49 @@ ],

"devDependencies": {
"grunt-browserify": "^2.1.4",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-nodeunit": "^0.3.3",
"grunt-contrib-watch": "^0.6.1",
"jshint-stylish": "^0.2.0",
"load-grunt-tasks": "^0.4.0",
"time-grunt": "^0.3.1"
"babel-cli": "^6.24.1",
"babel-plugin-external-helpers": "^6.22.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es3": "^1.0.1",
"mkdirp": "^0.5.1",
"nodeunit": "^0.11.0",
"npm-run-all": "^4.0.2",
"rimraf": "^2.6.1",
"rollup": "^0.41.6",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-json": "^2.1.1",
"rollup-watch": "^3.2.2",
"videojs-standard": "^5.2.0"
},
"scripts": {
"test": "grunt"
"prebuild": "npm run clean",
"build": "npm-run-all -p build:*",
"build:js": "npm-run-all -p build:js:modules build:js:umd build:js:pad build:js:unpad",
"build:js:modules": "rollup -c scripts/modules.rollup.js",
"build:js:umd": "rollup -c scripts/umd.rollup.js",
"build:js:pad": "rollup -c scripts/pad.rollup.js",
"build:js:unpad": "rollup -c scripts/unpad.rollup.js",
"build:test": "rollup -c scripts/test.rollup.js",
"clean": "rimraf dist test/dist",
"postclean": "mkdirp dist test/dist",
"lint": "vjsstandard",
"pretest": "npm-run-all lint build:test",
"test": "nodeunit test/dist/pkcs7_test.js",
"watch": "npm-run-all -p watch:*",
"watch:js": "npm-run-all -p watch:js:modules watch:js:umd watch:js:pad watch:js:unpad",
"watch:js:modules": "rollup -c scripts/modules.rollup.js -w",
"watch:js:umd": "rollup -c scripts/umd.rollup.js -w",
"watch:js:pad": "rollup -c scripts/pad.rollup.js -w",
"watch:js:unpad": "rollup -c scripts/unpad.rollup.js -w",
"watch:test": "rollup -c scripts/test.rollup.js -w",
"prepublish": "npm run build"
},
"bin": {
"pkcs7": "lib/cli.js"
"pkcs7": "bin/cli.js"
},
"vjsstandard": {
"ignore": [
"dist",
"docs",
"test/dist"
]
}
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc