How to generate a globally unique string id?

recently, I learned the node.js + koa + mysql backend. When I write a page, I always see that the requested interface has some string-based unique Id,. I don"t know how to do it myself. Please give me some advice

.
Apr.07,2021

there are many ways to globally unique strings, such as time-based, network card mac address, cpu id and so on. The standard is that the uuid, generation algorithm is standardized, and almost all languages have readily available methods.

method for MySQL to generate uuid

select uuid();

there are many ways for nodejs to generate uuid, such as using the node-uuid module.

execute: npm install node-uuid first

    var uuid = require('node-uuid');
    console.log(uuid.v1())
    console.log(uuid.v4())
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e49534-592ac.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e49534-592ac.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?