broadcast-channel
Advanced tools
Comparing version 4.3.1 to 4.4.0
@@ -5,2 +5,7 @@ # CHANGELOG | ||
## 4.4.0 (2 November 2021) | ||
Other: | ||
- Replaced `js-sha` with node's `crypto` module. | ||
## 4.3.1 (30 October 2021) | ||
@@ -7,0 +12,0 @@ |
@@ -47,2 +47,4 @@ "use strict"; | ||
var _crypto = _interopRequireDefault(require("crypto")); | ||
var _os = _interopRequireDefault(require("os")); | ||
@@ -60,4 +62,2 @@ | ||
var _jsSha = require("js-sha3"); | ||
var _detectNode = _interopRequireDefault(require("detect-node")); | ||
@@ -116,5 +116,10 @@ | ||
if (!getPathsCache.has(channelName)) { | ||
var channelHash = (0, _jsSha.sha3_224)(channelName); // use hash incase of strange characters | ||
/** | ||
* Use the hash instead of the channelName | ||
* to ensure we have no characters that cannot be used as filenames. | ||
* And also to ensure that trimming the string will not end up | ||
* in using the same folders for different channels. | ||
*/ | ||
var channelHash = _crypto["default"].createHash('sha256').update(channelName).digest('hex'); | ||
/** | ||
* because the lenght of socket-paths is limited, we use only the first 20 chars | ||
@@ -125,2 +130,3 @@ * and also start with A to ensure we do not start with a number | ||
var channelFolder = 'A' + channelHash.substring(0, 20); | ||
@@ -127,0 +133,0 @@ |
@@ -10,2 +10,3 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator"; | ||
import fs from 'fs'; | ||
import crypto from 'crypto'; | ||
import os from 'os'; | ||
@@ -17,3 +18,2 @@ import events from 'events'; | ||
import rimraf from 'rimraf'; | ||
import { sha3_224 } from 'js-sha3'; | ||
import isNode from 'detect-node'; | ||
@@ -51,5 +51,10 @@ import unload from 'unload'; | ||
if (!getPathsCache.has(channelName)) { | ||
var channelHash = sha3_224(channelName); // use hash incase of strange characters | ||
/** | ||
* Use the hash instead of the channelName | ||
* to ensure we have no characters that cannot be used as filenames. | ||
* And also to ensure that trimming the string will not end up | ||
* in using the same folders for different channels. | ||
*/ | ||
var channelHash = crypto.createHash('sha256').update(channelName).digest('hex'); | ||
/** | ||
* because the lenght of socket-paths is limited, we use only the first 20 chars | ||
@@ -56,0 +61,0 @@ * and also start with A to ensure we do not start with a number |
@@ -10,2 +10,3 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator"; | ||
import fs from 'fs'; | ||
import crypto from 'crypto'; | ||
import os from 'os'; | ||
@@ -17,3 +18,2 @@ import events from 'events'; | ||
import rimraf from 'rimraf'; | ||
import { sha3_224 } from 'js-sha3'; | ||
import isNode from 'detect-node'; | ||
@@ -51,5 +51,10 @@ import unload from 'unload'; | ||
if (!getPathsCache.has(channelName)) { | ||
var channelHash = sha3_224(channelName); // use hash incase of strange characters | ||
/** | ||
* Use the hash instead of the channelName | ||
* to ensure we have no characters that cannot be used as filenames. | ||
* And also to ensure that trimming the string will not end up | ||
* in using the same folders for different channels. | ||
*/ | ||
var channelHash = crypto.createHash('sha256').update(channelName).digest('hex'); | ||
/** | ||
* because the lenght of socket-paths is limited, we use only the first 20 chars | ||
@@ -56,0 +61,0 @@ * and also start with A to ensure we do not start with a number |
@@ -47,2 +47,4 @@ "use strict"; | ||
var _crypto = _interopRequireDefault(require("crypto")); | ||
var _os = _interopRequireDefault(require("os")); | ||
@@ -60,4 +62,2 @@ | ||
var _jsSha = require("js-sha3"); | ||
var _detectNode = _interopRequireDefault(require("detect-node")); | ||
@@ -116,5 +116,10 @@ | ||
if (!getPathsCache.has(channelName)) { | ||
var channelHash = (0, _jsSha.sha3_224)(channelName); // use hash incase of strange characters | ||
/** | ||
* Use the hash instead of the channelName | ||
* to ensure we have no characters that cannot be used as filenames. | ||
* And also to ensure that trimming the string will not end up | ||
* in using the same folders for different channels. | ||
*/ | ||
var channelHash = _crypto["default"].createHash('sha256').update(channelName).digest('hex'); | ||
/** | ||
* because the lenght of socket-paths is limited, we use only the first 20 chars | ||
@@ -125,2 +130,3 @@ * and also start with A to ensure we do not start with a number | ||
var channelFolder = 'A' + channelHash.substring(0, 20); | ||
@@ -127,0 +133,0 @@ |
{ | ||
"name": "broadcast-channel", | ||
"version": "4.3.1", | ||
"version": "4.4.0", | ||
"description": "A BroadcastChannel that works in New Browsers, Old Browsers, WebWorkers and NodeJs", | ||
@@ -82,5 +82,4 @@ "exports": { | ||
"dependencies": { | ||
"@babel/runtime": "^7.7.2", | ||
"@babel/runtime": "^7.16.0", | ||
"detect-node": "^2.1.0", | ||
"js-sha3": "0.8.0", | ||
"microseconds": "0.2.0", | ||
@@ -93,11 +92,11 @@ "nano-time": "1.0.0", | ||
"devDependencies": { | ||
"@babel/cli": "7.15.7", | ||
"@babel/core": "7.15.8", | ||
"@babel/plugin-proposal-object-rest-spread": "7.15.6", | ||
"@babel/plugin-transform-member-expression-literals": "7.14.5", | ||
"@babel/plugin-transform-property-literals": "7.14.5", | ||
"@babel/plugin-transform-runtime": "7.15.8", | ||
"@babel/cli": "7.16.0", | ||
"@babel/core": "7.16.0", | ||
"@babel/plugin-proposal-object-rest-spread": "7.16.0", | ||
"@babel/plugin-transform-member-expression-literals": "7.16.0", | ||
"@babel/plugin-transform-property-literals": "7.16.0", | ||
"@babel/plugin-transform-runtime": "7.16.0", | ||
"@babel/polyfill": "7.12.1", | ||
"@babel/preset-env": "7.15.8", | ||
"@babel/types": "7.15.6", | ||
"@babel/preset-env": "7.16.0", | ||
"@babel/types": "7.16.0", | ||
"@rollup/plugin-node-resolve": "13.0.6", | ||
@@ -118,3 +117,3 @@ "@types/core-js": "2.5.5", | ||
"jest": "27.3.1", | ||
"karma": "6.3.6", | ||
"karma": "6.3.7", | ||
"karma-babel-preprocessor": "8.0.1", | ||
@@ -135,3 +134,3 @@ "karma-browserify": "8.1.0", | ||
"random-token": "0.0.8", | ||
"rollup": "2.58.3", | ||
"rollup": "2.59.0", | ||
"rollup-plugin-terser": "7.0.2", | ||
@@ -141,3 +140,3 @@ "testcafe": "1.16.1", | ||
"typescript": "4.4.4", | ||
"uglify-js": "3.14.2", | ||
"uglify-js": "3.14.3", | ||
"watchify": "4.0.0", | ||
@@ -144,0 +143,0 @@ "webpack": "5.61.0", |
@@ -8,2 +8,3 @@ /** | ||
import fs from 'fs'; | ||
import crypto from 'crypto'; | ||
import os from 'os'; | ||
@@ -15,3 +16,2 @@ import events from 'events'; | ||
import rimraf from 'rimraf'; | ||
import { sha3_224 } from 'js-sha3'; | ||
import isNode from 'detect-node'; | ||
@@ -63,4 +63,11 @@ import unload from 'unload'; | ||
if (!getPathsCache.has(channelName)) { | ||
const channelHash = sha3_224(channelName); // use hash incase of strange characters | ||
/** | ||
* Use the hash instead of the channelName | ||
* to ensure we have no characters that cannot be used as filenames. | ||
* And also to ensure that trimming the string will not end up | ||
* in using the same folders for different channels. | ||
*/ | ||
const channelHash = crypto.createHash('sha256').update(channelName).digest('hex'); | ||
/** | ||
* because the lenght of socket-paths is limited, we use only the first 20 chars | ||
@@ -67,0 +74,0 @@ * and also start with A to ensure we do not start with a number |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
457291
7
11958
- Removedjs-sha3@0.8.0
- Removedjs-sha3@0.8.0(transitive)
Updated@babel/runtime@^7.16.0