drizzle-team / drizzle-team/drizzle-orm

[BUG]: drizzle-seed generates invalid RFC 4122 UUID v4 (wrong variant bits)

Open
#5,402 1 comment 2 reactions 0 assignees View on GitHub
bug bug/fixed-in-beta
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Report hasn't been filed before.

- [x] I have verified that the bug I'm about to report hasn't been filed before.

### What version of `drizzle-orm` are you using?

0.45.1

### What version of `drizzle-kit` are you using?

0.31.9

### Other packages

drizzle-seed@0.3.1

### Describe the Bug

drizzle-seed generates UUID v4 values that are not RFC 4122 compliant.

The generated UUIDs correctly set the version nibble (4), but they do not correctly restrict the variant bits. As a result, the first character of the 4th group is sometimes outside the allowed [8, 9, a, b] range.

Example of an invalid UUID generated by drizzle-seed:

`6aa65a86-1248-4dcf-e3ec-304ba1343ca5`

The 4th group starts with e, which violates the RFC 4122 variant requirement.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.