Skip to content

Commit

Permalink
Better Random (#972)
Browse files Browse the repository at this point in the history
This started as a small update.

This pull request includes updates to the `RandomUtil` class to improve
the security and accuracy of random number generation by utilizing the
`node:crypto` module. Additionally, it enhances the documentation and
refactors several methods for clarity and performance.

Includes tests, both before and after the changes.

The only *possible* breaking change is that now the `getKey`,
`getKeyValue`, and `drawRandomFromDict` methods are typed with generics
instead of `any`. I tried to keep them as *generic* as possible, but we
should probably include this in a BE to ensure it doesn't break
anything.

No further changes are planned--Saved as a draft because it's late and I
still want to review.

---------

Co-authored-by: Chomp <[email protected]>
  • Loading branch information
refringe and chompDev authored Dec 6, 2024
1 parent 9ef8206 commit c071702
Show file tree
Hide file tree
Showing 3 changed files with 858 additions and 65 deletions.
14 changes: 13 additions & 1 deletion project/biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,17 @@
"formatter": {
"trailingCommas": "none"
}
}
},
"overrides": [
{
"include": ["tests/*"],
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "off"
}
}
}
}
]
}
Loading

0 comments on commit c071702

Please sign in to comment.