且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

删除“-"有多安全?在随机生成的 UUID 中?

更新时间:2023-09-27 21:22:46

如果删除生成的 UUID 中的-"有多安全

how safe if is to remove the "-" in the generated UUID

它是 100% 安全的,因为破折号不是值的一部分.字符串 UUID 是 128 位值的十六进制表示.破折号仅用于显示目的,因此 UUID 会更容易显示.

It's 100% safe since the dashes aren't part of the value. The String UUID is a hex representation of a 128 bit value. The dashes are there just for display purposes so UUIDs will be a bit easier on the eyes.

在将 String 形式的 UUID 传递给外部系统(例如外部 API、数据库和类似性质的东西)时,请务必小心.他们可能希望破折号出现.

Just be careful when passing UUIDs in String form to external systems such as external APIs, databases, and things of that nature. They might be expecting the dashes to be there.