From 99c1e067b17d9b57245ee793c7b08b0c93de54b0 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 18 Jun 2015 21:42:21 +0200 Subject: bin/genid: initial commit --- bin/genid | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 bin/genid diff --git a/bin/genid b/bin/genid new file mode 100755 index 000000000..8e2240746 --- /dev/null +++ b/bin/genid @@ -0,0 +1,11 @@ +#! /bin/sh +# usage: genid NAME +set -euf +name=$1 +hash=$(printf %s "$name" | sha1sum | cut -d\ -f1 | tr a-f A-F) +echo " + min=2^16 # bigger than nobody and nogroup, see + max=2^32 # see 2^(8*sizeof(uid_t)) + ibase=16 + ($hash + min) % max +" | bc -- cgit v1.2.3 [cgit] Unable to lock slot /tmp/cgit/85300000.lock: No such file or directory (2)