summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-05-09 08:28:24 -0300
committerEuAndreh <eu@euandre.org>2025-05-09 08:28:24 -0300
commit83490f3cbe48fcef54c49a788337a1e7a681e6fa (patch)
tree9d414d08e9b453b939619a4da0b497b168775a84
parentsrc/pre: Use sed(1) and handle buffering with stdbuf(1) (diff)
downloadeut-83490f3cbe48fcef54c49a788337a1e7a681e6fa.tar.gz
eut-83490f3cbe48fcef54c49a788337a1e7a681e6fa.tar.xz
src/urlid: Add working version, based on uuid(1) and xxxd(1)
-rw-r--r--deps.mk1
-rwxr-xr-xsrc/urlid8
2 files changed, 9 insertions, 0 deletions
diff --git a/deps.mk b/deps.mk
index 13df7a4..67f8625 100644
--- a/deps.mk
+++ b/deps.mk
@@ -20,6 +20,7 @@ sources.sh = \
src/timestamp \
src/untill \
src/uri \
+ src/urlid \
src/uuid \
src/varlist \
diff --git a/src/urlid b/src/urlid
new file mode 100755
index 0000000..7d1f02a
--- /dev/null
+++ b/src/urlid
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -eu
+
+uuid "$@" |
+ tr -d '-' |
+ xxxd |
+ base64 |
+ sed -e 's|/|_|g' -e 's|+|-|g' -e 's|=||g'