sip-nonce 0.3.0 → 0.3.2

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.
Files changed (2) hide show
  1. package/README.md +35 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1 +1,35 @@
1
- Small library for generating random SIP nonce values
1
+ ## Small library for generating random SIP nonce values
2
+
3
+ Contains both CommonJS and ESM modules for generating SIP-compatible random string values between 10 and 24 chars in length.
4
+
5
+ Note: for speed, this library does not use crypto libraries for generating random bytes or seed data. It just uses several iterations of A-Z,a-z,0-9, shuffled and then randomly sliced into a substring.
6
+
7
+ **Installation**
8
+
9
+ ```
10
+ npm install sip-nonce
11
+ ```
12
+
13
+ **Usage Examples**
14
+
15
+ ```javascript
16
+ // For ESM use
17
+ import nonce from "sip-nonce";
18
+
19
+ // OR, for CommonJS use
20
+ const nonce = require("sip-nonce");
21
+ ```
22
+
23
+ ```javascript
24
+ // by default this will generate a 10 char string
25
+ const n = nonce();
26
+
27
+ // generate a 12 char string
28
+ const n = nonce(12);
29
+
30
+ // generate a string with a random length between 10 and 12 (recommended)
31
+ const n = nonce(10, 12);
32
+
33
+ // a string with a random length between 10 and 24
34
+ const n = nonce(10, 24);
35
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sip-nonce",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Small library for generating random nonce values for SIP challenges",
5
5
  "keywords": [
6
6
  "sip-nonce",