Skip to content

Commit 1d88602

Browse files
committed
README tweak
1 parent f3d3fab commit 1d88602

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//: [Previous](@previous)
22
//: ## TLDR 2
33
//: ### Take Away
4-
//:
54
//: - You don't need random strings of length L.
65
//: - String length is a by-product, not a goal.
76
//: - You don't need truly unique strings.
@@ -12,11 +11,10 @@
1211
//: - You need to a total of **_N_** strings with a risk **_1/n_** of repeat.
1312
//: - The characters are arbitrary.
1413
//: - You need `EntropyString`.
14+
//: ##### In a million strings, a 1 in a billion chance of a repeat (using 32 possible characters):
1515
import EntropyString
1616

17-
let N: Entropy.Power = .ten06
18-
let n: Entropy.Power = .ten09
19-
var bits = Entropy.bits(for: N, risk: n)
17+
let bits = Entropy.bits(for: .ten06, risk: .ten09)
2018
let string = RandomString.entropy(of: bits, using: .charSet32)
2119
//: * callout(string): DdHrT2NdrHf8tM
2220

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -532,12 +532,11 @@ Note how the number of bytes needed is dependent on the number of characters in
532532
- The characters are arbitrary.
533533
- You need `EntropyString`.
534534

535+
##### In a *million* strings, a *1 in a billion* chance of a repeat (using 32 possible characters):
535536
```swift
536537
import EntropyString
537538

538-
let N: Entropy.Power = .ten06
539-
let n: Entropy.Power = .ten09
540-
var bits = Entropy.bits(for: N, risk: n)
539+
let bits = Entropy.bits(for: .ten06, risk: .ten09)
541540
let string = RandomString.entropy(of: bits, using: .charSet32)
542541
```
543542

0 commit comments

Comments
 (0)