Is a UUID “URL safe”?

前端 未结 1 951
长情又很酷
长情又很酷 2020-12-09 14:45

Is a UUID URL safe? I want to use it as an alternate ID yet perhaps allowing access to the record as the ID in the URL. While I can use Ruby’s SecureRandom.urlsafe_bas

相关标签:
1条回答
  • 2020-12-09 15:26

    Yes.

    • A UUID consists of only hexadecimal characters (a–f, 0–9) plus a hyphen (-).

    • As per RFC 3986 (URI Syntax) §2.3, hyphen and hexadecimal characters are included in those explicitly unreserved:

      Characters that are allowed in a URI but do not have a reserved purpose are called unreserved. These include uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde.

    0 讨论(0)
提交回复
热议问题