You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -170,7 +170,7 @@ Ah, now we're getting somewhere. The answer to question 3 might lead to the furt
170
170
171
171
*I need to generate 10,000 random, unique IDs*.
172
172
173
-
And the cat's out of the bag. We're getting at the real need, and it's not the same as the original statement. The developer needs *uniqueness* across a total of some number of strings. The length of the string is a by-product of the uniqueness, not the goal.
173
+
And the cat's out of the bag. We're getting at the real need, and it's not the same as the original statement. The developer needs *uniqueness* across a total of some number of strings. The length of the string is a by-product of the uniqueness, not the goal, and should not be the primary specification for the random string.
174
174
175
175
As noted in the [Overview](#Overview), guaranteeing uniqueness is difficult, so we'll replace that declaration with one of *probabilistic uniqueness* by asking:
176
176
@@ -325,19 +325,23 @@ The available `CharSet`s are *charSet64*, *charSet32*, *charSet16*, *charSet8*,
* Remove all upper and lower case vowels (including y)
330
331
* Remove all numbers that look like letters
331
332
* Remove all letters that look like numbers
332
333
* Remove all letters that have poor distinction between upper and lower case values.
333
334
The resulting strings don't look like English words and are easy to parse visually.
334
-
335
+
335
336
- CharSet 16: **0123456789abcdef**
336
337
* Hexadecimal
338
+
337
339
- CharSet 8: **01234567**
338
340
* Octal
341
+
339
342
- CharSet 4: **ATCG**
340
343
* DNA alphabet. No good reason; just wanted to get away from the obvious.
344
+
341
345
- CharSet 2: **01**
342
346
* Binary
343
347
@@ -367,7 +371,7 @@ The resulting string of __0__'s and __1__'s doesn't look quite right. Perhaps yo
367
371
368
372
> flips: THHTHTTHHT
369
373
370
-
As another example, we saw in [Character Sets](#CharacterSets) the predefined characters for `charSet16` are **0123456789abcdef**. Suppose you like uppercase hexadecimal letters instead.
374
+
As another example, we saw in [Character Sets](#CharacterSets) the predefined hex characters for `charSet16` are lowercase. Suppose you like uppercase hexadecimal letters instead.
371
375
372
376
```js
373
377
import {Random} from'entropy-string'
@@ -385,7 +389,7 @@ The `Random` constructor allows for three separate cases:
385
389
- One of six predefined `CharSet`s can be specified.
386
390
- A string representing the characters to use can be specified.
387
391
388
-
The 3rd option above will throw an `EntropyStringError` if the characters string isn't appropriate for creating a `CharSet`.
392
+
The last option above will throw an `EntropyStringError` if the characters string isn't appropriate for creating a `CharSet`.
0 commit comments