Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7835b90

Browse files
committed
Example futzing
1 parent766d5bd commit7835b90

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
constrandom=newRandom(charSet16)
68
constbits=Entropy.bits(30,100000)
79
letstring=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('\nBase 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
constrandom=newRandom()
66
conststring=random.smallID()
77

8-
console.log('\n Small IDwith 1 in a million chance of repeat for 30 strings: '+string+'\n')
8+
console.log('\n Small IDhas 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
constrandom=newRandom(charSet64)
6-
conststring=random.sessionID()
76

8-
console.log('\n OWASP session ID using RFC 4648 file system and URL safe characters: '+string+'\n')
7+
conststring=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)

[8]ページ先頭

©2009-2026 Movatter.jp