rand: add uuid_v7(), session function, simplify uuid_v4() (#24313)

This commit is contained in:
kbkpbot 2025-04-25 23:30:57 +08:00 committed by GitHub
parent 0bcfd0f9ea
commit e0a7f87693
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 150 additions and 59 deletions

View file

@ -701,7 +701,7 @@ pub fn read(mut buf []u8) {
}
const english_letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
const hex_chars = 'abcdef0123456789'
const hex_chars = '0123456789abcdef'
const ascii_chars = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\\^_`abcdefghijklmnopqrstuvwxyz{|}~'
// ulid generates an unique lexicographically sortable identifier.