UUID 最大字符长度

编程入门 行业动态 更新时间:2024-10-26 21:19:25
本文介绍了UUID 最大字符长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们使用 UUID 作为 out oracle DB 的主键,并尝试为 VARCHAR 确定适当的最大字符长度.显然这是 36 个字符,但我们注意到生成的 UUID 比这更长 - 长度最多为 60 个字符.有谁知道 UUID 合适的最大字符长度??

We are using UUID as primary key for out oracle DB, and trying to determine an appropriate max character length for the VARCHAR. Apparently this is 36 characters but we have noticed UUID'S generated which are longer than this - up to 60 characters in length. Does anyone know a suitable max char length for UUID??

推荐答案

RFC4122 的第 3 节 提供了 UUID 字符串表示的正式定义.它是 36 个字符(32 个十六进制数字 + 4 个破折号).

Section 3 of RFC4122 provides the formal definition of UUID string representations. It's 36 characters (32 hex digits + 4 dashes).

听起来您需要弄清楚无效的 60 字符 ID 的来源并决定 1) 是否要接受它们,以及 2) 这些 ID 的最大长度可能基于所使用的任何 API生成它们.

Sounds like you need to figure out where the invalid 60-char IDs are coming from and decide 1) if you want to accept them, and 2) what the max length of those IDs might be based on whatever API is used to generate them.

更多推荐

UUID 最大字符长度

本文发布于:2023-11-11 10:16:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1578142.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:长度   字符   UUID

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!