2024-11-05 10:09:18 +08:00

13 lines
293 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 生成010000的随机数
*/
export const generateId = (): number => Math.floor(Math.random() * 10000)
/**
* 生成随机数0 max
* @param max 最大值
* @returns 随机数
*/
export const getRandomInt = (max: number) =>
Math.floor(Math.random() * Math.floor(max))