PeerTube/shared/core-utils/common/random.ts

9 lines
148 B
TypeScript
Raw Normal View History

2021-12-17 13:58:07 +01:00
// high excluded
function randomInt (low: number, high: number) {
return Math.floor(Math.random() * (high - low) + low)
}
export {
randomInt
}