aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/id.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/app/id.go')
-rw-r--r--internal/app/id.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/app/id.go b/internal/app/id.go
new file mode 100644
index 00000000..e996a3a6
--- /dev/null
+++ b/internal/app/id.go
@@ -0,0 +1,18 @@
+package app
+
+import (
+ "crypto/rand"
+ "encoding/hex"
+)
+
+type appID [16]byte
+
+func (a *appID) String() string {
+ return hex.EncodeToString(a[:])
+}
+
+func newAppID() (*appID, error) {
+ a := &appID{}
+ _, err := rand.Read(a[:])
+ return a, err
+}