I am using UUID
to generate random codes. But It's returning me 20+ digits. Is there is any other algorithm mechanism that returns 8-digit code that is unique or any other way to reduce UUID code length.
Code
const uuidv4 = require('uuid/v4');
uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
Aucun commentaire:
Enregistrer un commentaire