sip-nonce 0.2.6 → 0.3.0

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/dist/cjs/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const nonce = function (minLength = 8, maxLength = 10) {
3
+ const nonce = function (minLength = 10, maxLength = 12) {
4
4
  if (typeof minLength != "number" || minLength < 8)
5
5
  minLength = 8;
6
6
  if (typeof maxLength != "number" || maxLength > 24)
7
7
  maxLength = 24;
8
8
  const length = randomInt(minLength, maxLength);
9
- const offset = randomInt(1, 17);
9
+ const offset = randomInt(0, maxLength);
10
10
  let chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
11
- chars = shuffleString(chars.repeat(4));
11
+ chars = shuffleString(chars.repeat(3));
12
12
  let res = "";
13
13
  for (let i = 0; i < length + offset + 1; i++) {
14
14
  res += chars.charAt(Math.floor(Math.random() * chars.length));
package/dist/esm/index.js CHANGED
@@ -1,12 +1,12 @@
1
- const nonce = function (minLength = 8, maxLength = 10) {
1
+ const nonce = function (minLength = 10, maxLength = 12) {
2
2
  if (typeof minLength != "number" || minLength < 8)
3
3
  minLength = 8;
4
4
  if (typeof maxLength != "number" || maxLength > 24)
5
5
  maxLength = 24;
6
6
  const length = randomInt(minLength, maxLength);
7
- const offset = randomInt(1, 17);
7
+ const offset = randomInt(0, maxLength);
8
8
  let chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
9
- chars = shuffleString(chars.repeat(4));
9
+ chars = shuffleString(chars.repeat(3));
10
10
  let res = "";
11
11
  for (let i = 0; i < length + offset + 1; i++) {
12
12
  res += chars.charAt(Math.floor(Math.random() * chars.length));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sip-nonce",
3
- "version": "0.2.6",
4
- "description": "Small library for generating random SIP nonce values",
3
+ "version": "0.3.0",
4
+ "description": "Small library for generating random nonce values for SIP challenges",
5
5
  "keywords": [
6
6
  "sip-nonce",
7
7
  "sip",
@@ -39,7 +39,6 @@
39
39
  "sideEffects": false,
40
40
  "devDependencies": {
41
41
  "prettier": "^3.7.4",
42
- "ts-node": "^10.9.2",
43
42
  "typescript": "^5.9.3"
44
43
  }
45
44
  }