7

【笔记】Java生成UUID

 2 years ago
source link: https://feiju12138.github.io/2022/07/16/Java%E7%94%9F%E6%88%90UUID/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

通用唯一识别码(英语:Universally Unique Identifier,缩写:UUID)是用于计算机体系中以识别信息的一个128位标识符。
根据标准方法生成,不依赖中央机构的注册和分配,UUID具有唯一性,这与其他大多数编号方案不同。重复UUID码概率接近零,可以忽略不计。(维基百科)

生成UUID

UUID.randomUUID().toString();

生成没有分隔符的32位数字

UUID.randomUUID().toString().replace("-", "");

博客园——jdonson


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK