Skip to content

Commit 5c14ac9

Browse files
Fix typo
1 parent d44c3d9 commit 5c14ac9

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

source/utils.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ import { ENCODING, ENCODING_LEN } from "./constants.js";
22
import { PRNG } from "./types.js";
33

44
export function randomChar(prng: PRNG): string {
5-
65
// Currently PRNGs generate fractions from 0 to _less than_ 1, so no "%" is necessary.
76
// However, just in case a future PRNG can generate 1,
87
// we are applying "% ENCODING LEN" to wrap back to the first character
9-
108
const randomPosition = Math.floor(prng() * ENCODING_LEN) % ENCODING_LEN;
11-
return ENCODING.charAt(randPosition);
9+
return ENCODING.charAt(randomPosition);
1210
}
1311

1412
export function replaceCharAt(str: string, index: number, char: string): string {

0 commit comments

Comments
 (0)