a uuid v4 generator written in arm64 assembly.
generates RFC 4122 compliant uuid v4s using /dev/urandom for entropy using just raw syscalls
built this as a qol tool for myself and to learn a bit assembly
- apple silicon mac (m1/m2/m3/m4)
- xcode command line tools
make
./nuidthen enter how many uuids you want. thats it.
$ ./nuid
Enter number of UUIDs to generate: 3
a1b2c3d4-e5f6-4789-abcd-ef0123456789
deadbeef-cafe-4bab-8000-000000000001
12345678-90ab-4def-8123-456789abcdef
its pretty fast
$ time (echo 100000 | ./nuid > /dev/null)
real 0m0.153s
- reads from
/dev/urandomfor 16 random bytes - sets version bits (byte 6 high nibble = 0x4)
- sets variant bits (byte 8 = 10xxxxxx)
- formats to hex string with dashes
- prints it
- repeat
main.s - entry point n main loop
constants.s - syscall nums, strings, buffers
io.s - print/read/file ops
convert.s - atoi for parsing input
uuid.s - uuid formatting n version bits
Makefile - build stuff
this is a hobby project. if you need production grade uuids maybe use something else.