jammymalina / is-valid-uuid-v4

MIT License
4 stars 0 forks source link

isValidUUIDV4 returns true for V5 UUIDs #17

Open christhegrand opened 10 months ago

christhegrand commented 10 months ago

Here is a sample V5 UUID: d4817bfe-2687-5591-bdc9-2aebfe4c6733

This library says it is a V4 UUID, when it is not.

> const {isValidUUIDV4} = require('is-valid-uuid-v4')
undefined
> isValidUUIDV4('d4817bfe-2687-5591-bdc9-2aebfe4c6733')
true

It looks like the UUID regex only checks whether the string is a UUID, and doesn't validate which UUID version it is.

jammymalina commented 10 months ago

Nice catch! It will be fixed in version 2