2021-10-11 12:00:59 -07:00
|
|
|
export const PLACEHOLDER_CHAR = '█';
|
|
|
|
|
2022-11-12 06:18:24 -08:00
|
|
|
export const generateText = (length: number) => {
|
2021-10-11 12:00:59 -07:00
|
|
|
let text = '';
|
|
|
|
|
|
|
|
for (let i = 0; i < length; i++) {
|
|
|
|
text += PLACEHOLDER_CHAR;
|
|
|
|
}
|
|
|
|
|
|
|
|
return text;
|
|
|
|
};
|
|
|
|
|
|
|
|
// https://stackoverflow.com/a/7228322/8811886
|
2022-11-12 06:18:24 -08:00
|
|
|
export const randomIntFromInterval = (min: number, max: number) => {
|
2021-10-11 12:00:59 -07:00
|
|
|
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
|
|
};
|