Comments (6)
Hi, I'm not so sure those examples are valid UUIDs, and the regex you are using doesn't appear to be the same valid one from the example.
The RFC 4122 spec denotes that the version number should be set as the 4 most significant bits of the time-high-and-version
block (first number of the 3rd block), and the variant is a variable number of most significant bits in the clock-seq-and-reserved
(first number of 4th block for our use case).
Valid versions are [1 - 5] and valid variants are [89ab].
In your examples it is specifying version 7, which as far as I'm aware isn't a valid version number.
from is-uuid.
the regex you are using doesn't appear to be the same valid one from the example
Yeah: I actually copied this example in the answer below the one mentioned: https://stackoverflow.com/a/7905992/712005 which on first sight seemed same but actually is different. Sorry for the confusion.
I updated the sandbox to show testing with both regexes.
In your examples it is specifying version 7, which as far as I'm aware isn't a valid version number
To be honest: I am not able to follow your arguments. Because I understand nothing of uuid's besides hoping that they may never collide. So I assume you are right and obviously version 7 does not exist. Weird that validator says they are correct though.
from is-uuid.
I checked and found out that these two UUID's were entered manually into our database. So that was probably just a simple error from someone like me who did not know what he was doing :-(
Thanks for this great tool.
Closing.
from is-uuid.
The reason validator
is giving you a false positive is because their regex is wrong.
https://github.com/validatorjs/validator.js/blob/c26558103efd228430f8437f68ee46c78ef8aceb/lib/isUUID.js#L16
I've raised a ticket with them
validatorjs/validator.js#1088
from is-uuid.
I've raised a ticket with them
Me too (closed again). Long live open source ;-)
from is-uuid.
\0/
Thanks for taking the time to put together comprehensive examples and test cases :-)
from is-uuid.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from is-uuid.