Sha256: 7d950bc42f262159a2786eea30d1153a3d0bca9aab9acdbcc1a981a8d2854ef7

Contents?: true

Size: 1.24 KB

Versions: 32

Compression:

Stored size: 1.24 KB

Contents

;(function (root, factory, undef) {
	if (typeof exports === "object") {
		// CommonJS
		module.exports = exports = factory(require("./core"), require("./cipher-core"));
	}
	else if (typeof define === "function" && define.amd) {
		// AMD
		define(["./core", "./cipher-core"], factory);
	}
	else {
		// Global (browser)
		factory(root.CryptoJS);
	}
}(this, function (CryptoJS) {

	/**
	 * ANSI X.923 padding strategy.
	 */
	CryptoJS.pad.AnsiX923 = {
	    pad: function (data, blockSize) {
	        // Shortcuts
	        var dataSigBytes = data.sigBytes;
	        var blockSizeBytes = blockSize * 4;

	        // Count padding bytes
	        var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;

	        // Compute last byte position
	        var lastBytePos = dataSigBytes + nPaddingBytes - 1;

	        // Pad
	        data.clamp();
	        data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);
	        data.sigBytes += nPaddingBytes;
	    },

	    unpad: function (data) {
	        // Get number of padding bytes from last byte
	        var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;

	        // Remove padding
	        data.sigBytes -= nPaddingBytes;
	    }
	};


	return CryptoJS.pad.Ansix923;

}));

Version data entries

32 entries across 32 versions & 3 rubygems

Version Path
appmap-0.72.2 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.72.1 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.72.0 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.71.0 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.70.2 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.70.1 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.70.0 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.69.0 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.68.2 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.68.1 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.68.0 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.67.1 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.67.0 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.66.2 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.66.1 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.66.0 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.65.1 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.65.0 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.64.0 ./node_modules/crypto-js/pad-ansix923.js
appmap-0.63.0 ./node_modules/crypto-js/pad-ansix923.js