python 中除了UUID可以生成唯一ID外,还有其他方法吗?这个UUID虽然可以做到,但太长了,有没有生成唯一ID比较短的方法?
迷茫2017-04-17 18:03:30
Wouldn’t it be enough to automatically increase the player character ID and database ID?
You don’t need to set the ID yourself
Every time you add a new role, the server ID will be automatically +1
It will be unique in the same table
If it is multiple tables
Unique ID solution for sub-database and sub-table,
You can create a special ID table id_table, with only one column of ID and it is the primary key
Every time you insert a player role player_role record, first insert a record into the id_table and then
use LAST_INSERT_ID as player_role new id
怪我咯2017-04-17 18:03:30
Maybe you can refer to it first:
shortuuid
Questions I answered: Python-QA