use secure random number generation in lieu of (#9320) (#9355)

Co-authored-by: lane-wetmore <lane.wetmore@hashicorp.com>
This commit is contained in:
Vault Automation 2025-09-15 18:52:58 -04:00 committed by GitHub
parent b4a1f08580
commit 37ddf246b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,7 +56,8 @@ function getTotalCounts(array) {
}
function randomBetween(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
const secureRandom = crypto.getRandomValues(new Uint32Array(1))[0] * Math.pow(2, -32);
return Math.floor(secureRandom * (max - min + 1) + min);
}
function generateMountBlock(path, counts) {