M
Modular9mo ago
benny

Compile Time UUID

Dainemo does a good job accomplishing this (https://github.com/StijnWoestenborghs/dainemo/blob/main/dainemo/utils/uuid.mojo) But I wonder if there is a better way using instrinsics or system calls to get the time (Since time.now() doesnt work at compile time) The goal being of course to be able to run the following code
alias UUID_ONE = generate_uuidv4()
alias UUID_TWO = generate_uuidv4()

fn main():
print(UUID_ONE == UUID_TWO)
alias UUID_ONE = generate_uuidv4()
alias UUID_TWO = generate_uuidv4()

fn main():
print(UUID_ONE == UUID_TWO)
Where the output is
GitHub
dainemo/dainemo/utils/uuid.mojo at main · StijnWoestenborghs/dainemo
A Machine Learning framework from scratch in Mojo 🔥 - StijnWoestenborghs/dainemo
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server