+
95
-

js如何生成唯一时间id?

js如何生成唯一时间id?


网友回复

+
15
-

一. 引入时间戳,生成可控长度的随机数:

function genID(length){
    return Number(Math.random().toString().substr(3,length) + Date.now()).toString(36);
}
二. JS 生成随机: 如:07854BB7-6572-496E-918B-81115BCF3...

点击查看剩余70%

我知道答案,我要回答