Skip to content

Commit 7835b90

Browse files
committed
Example futzing
1 parent 766d5bd commit 7835b90

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

examples/more_2.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
import {Random, Entropy, charSet16, charSet4} from './entropy-string'
44

5+
console.log('\n 30 potential strings with 1 in a million risk of repeat: \n')
6+
57
const random = new Random(charSet16)
68
const bits = Entropy.bits(30, 100000)
79
let string = random.string(bits)
8-
console.log('\n Base 16 string : ' + string)
10+
console.log(' Base 16: ' + string + '\n')
911

1012
random.use(charSet4)
1113
string = random.string(bits)
12-
console.log('\n Base 4 string : ' + string + '\n')
14+
console.log(' Base 4 : ' + string + '\n')

examples/tldr_4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ import {Random} from './entropy-string'
55
const random = new Random()
66
const string = random.smallID()
77

8-
console.log('\n Small ID with 1 in a million chance of repeat for 30 strings: ' + string + '\n')
8+
console.log('\n Small ID has 1 in a million chance of repeat for 30 strings: ' + string + '\n')

examples/tldr_6.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
// OWASP session ID using RFC 4648 file system and URL safe characters
1+
// Base 64 character 256 bit token
2+
3+
import {Random, Entropy, charSet64} from './entropy-string'
24

3-
import {Random, charSet64} from './entropy-string'
4-
55
const random = new Random(charSet64)
6-
const string = random.sessionID()
76

8-
console.log('\n OWASP session ID using RFC 4648 file system and URL safe characters: ' + string + '\n')
7+
const string = random.token()
8+
9+
console.log('\n 256 bit token using RFC 4648 URL and file system safe characters: ' + string + '\n')

examples/tldr_7.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy