How to design and generate user uid?

(the mobile version can"t upload the picture, go back to make it up tonight)

General uid. If the figure above is a string of fixed-length numbers, how is it generated? When storing uid in a database, doesn"t it usually start at 1 and then grow itself? How to implement this fixed-length id? Now I don"t know if I have a way of thinking: in the database, the uid, will grow from 1 to 21, and then there will be different digits of id of 1 and 21. When displaying, will the non-fixed-length uid be encrypted into a fixed-length uid for display through a certain encryption algorithm?


import uuid
uid = uuid.uuid1()

fixed length is easy to do:

  

learn about hashids

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-1b31418-2bd87.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-1b31418-2bd87.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?