summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-05-08 06:18:17 -0300
committerEuAndreh <eu@euandre.org>2024-05-08 08:24:02 -0300
commit807361bbb8460ab9a6d5acbb38010465835a7aee (patch)
tree2acef0d3a5da1cbd0536831ea4c8a930786db936
parentAdd basic Makefile (diff)
downloadeut-807361bbb8460ab9a6d5acbb38010465835a7aee.tar.gz
eut-807361bbb8460ab9a6d5acbb38010465835a7aee.tar.xz
src/uuid: Add working utility
-rw-r--r--deps.mk1
-rwxr-xr-xsrc/uuid5
2 files changed, 6 insertions, 0 deletions
diff --git a/deps.mk b/deps.mk
index 6905692..fbae84d 100644
--- a/deps.mk
+++ b/deps.mk
@@ -1,4 +1,5 @@
sources.sh = \
src/now \
src/timestamp \
+ src/uuid \
diff --git a/src/uuid b/src/uuid
new file mode 100755
index 0000000..9f181a5
--- /dev/null
+++ b/src/uuid
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -eu
+
+od -xN20 /dev/urandom |
+ awk 'NR == 1 { OFS="-"; print $2$3,$4,$5,$6,$7$8$9; exit }'