mybase 1.1.9 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/ts/funcs/randomIP6.js +1 -1
- package/ts/funcs/randomIP6.ts +1 -1
package/package.json
CHANGED
package/ts/funcs/randomIP6.js
CHANGED
|
@@ -11,6 +11,6 @@ const ip6_1 = __importDefault(require("ip6"));
|
|
|
11
11
|
function randomIP6() {
|
|
12
12
|
var _a;
|
|
13
13
|
const bytes = (0, crypto_1.randomBytes)(16);
|
|
14
|
-
return ip6_1.default.normalize(((_a = bytes.toString('hex').match(/.{1,4}/g)) === null || _a === void 0 ? void 0 : _a.join(':')) || '0000:0000:0000:0000:0000:0000:0000:0000');
|
|
14
|
+
return ip6_1.default.abbreviate(ip6_1.default.normalize(((_a = bytes.toString('hex').match(/.{1,4}/g)) === null || _a === void 0 ? void 0 : _a.join(':')) || '0000:0000:0000:0000:0000:0000:0000:0000'));
|
|
15
15
|
}
|
|
16
16
|
exports.randomIP6 = randomIP6;
|
package/ts/funcs/randomIP6.ts
CHANGED
|
@@ -5,7 +5,7 @@ import ip6 from 'ip6'
|
|
|
5
5
|
|
|
6
6
|
export function randomIP6() : string {
|
|
7
7
|
const bytes = randomBytes(16)
|
|
8
|
-
return ip6.normalize(bytes.toString('hex').match(/.{1,4}/g)?.join(':') || '0000:0000:0000:0000:0000:0000:0000:0000')
|
|
8
|
+
return ip6.abbreviate(ip6.normalize(bytes.toString('hex').match(/.{1,4}/g)?.join(':') || '0000:0000:0000:0000:0000:0000:0000:0000'))
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
|