js生成一个永不重复的ID

生成永不重复的ID

/**
 * 生成一个用不重复的ID
 */
function GenNonDuplicateID() {
    str = Math.random().toString(36).substr(3);
    str += Date.now().toString(16).substr(4);
    return str;
}
posted @ 2020-08-11 17:19  yangzixiongh  阅读(923)  评论(0编辑  收藏  举报