aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/id.go
blob: 6ca4831234f4800cb5c1fa0dc53e6d77bea63651 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package app

import (
	"crypto/rand"
	"encoding/hex"
)

type ID [16]byte

func (a *ID) String() string {
	return hex.EncodeToString(a[:])
}

func newAppID(id *ID) error {
	_, err := rand.Read(id[:])
	return err
}