fst: implement app id parser
All checks were successful
Tests / Go tests (push) Successful in 40s
Nix / NixOS tests (push) Successful in 3m8s

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
2024-12-19 18:19:47 +09:00
parent f796622c35
commit 5ea7333431
3 changed files with 111 additions and 16 deletions

View File

@@ -1,18 +1,2 @@
// Package fst exports shared fortify types.
package fst
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
}