uuid 生成问题

参考:
https://www.jianshu.com/p/1c2fb05d9ca9
https://www.rfc-editor.org/rfc/rfc4122
https://docs.python.org/3/library/uuid.html
https://www.cnblogs.com/security-darren/p/4252868.html
https://www.cryptosys.net/pki/uuid-rfc4122.html

结论:
uuid 有 1345 版本,35 版本根据命名空间和名字生成固定的 uuid,3 和 5 的主要区别是 3 md5 / 5 sha1 的 hash 算法区别;
1 版本是根据时间、本机 mac 地址生成的,会有隐私问题;
4 是随机的,但又内部协议,3-1 字符固定是 4 ,4-1 字符固定是 '8' / '9' / 'a' / 'b'

第三段前四位固定是 0100
第四段第一位固定是 1 第二位固定是 0

  1. 第三段的前 4 位二进制为版本号,固定 12345
  2. 读完就清楚了: https://datatracker.ietf.org/doc/html/rfc4122.html

主流默认是随机 version 4

你可能感兴趣的:(uuid 生成问题)