diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-28 18:10:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-28 18:10:10 +0300 |
commit | 52e04ab29a16fdc40bb3caa031db08fc690c5a30 (patch) | |
tree | 53cf15370054f80a767229ae0291ca4250e8355e /lib/gitlab/uuid.rb | |
parent | e131979e83ca7aab4fdc30166afde12a295105ac (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/uuid.rb')
-rw-r--r-- | lib/gitlab/uuid.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/gitlab/uuid.rb b/lib/gitlab/uuid.rb index 12a4efabc44..80caf2c6788 100644 --- a/lib/gitlab/uuid.rb +++ b/lib/gitlab/uuid.rb @@ -9,6 +9,7 @@ module Gitlab production: "58dc0f06-936c-43b3-93bb-71693f1b6570" }.freeze + UUID_V5_PATTERN = /\h{8}-\h{4}-5\h{3}-\h{4}-\h{4}\h{8}/.freeze NAMESPACE_REGEX = /(\h{8})-(\h{4})-(\h{4})-(\h{4})-(\h{4})(\h{8})/.freeze PACK_PATTERN = "NnnnnN".freeze @@ -17,6 +18,10 @@ module Gitlab Digest::UUID.uuid_v5(namespace_id, name) end + def v5?(string) + string.match(UUID_V5_PATTERN).present? + end + private def default_namespace_id |