From b2fc689bdcff28bf75c0128db19ba4730d726b4f Mon Sep 17 00:00:00 2001 From: simponic Date: Thu, 28 Mar 2024 12:57:35 -0400 Subject: dns api (#1) Co-authored-by: Elizabeth Hunt Reviewed-on: https://git.hatecomputers.club/hatecomputers/hatecomputers.club/pulls/1 --- utils/RandomId.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'utils') diff --git a/utils/RandomId.go b/utils/RandomId.go index 09f089d..1b03ec8 100644 --- a/utils/RandomId.go +++ b/utils/RandomId.go @@ -6,14 +6,11 @@ import ( ) func RandomId() string { - uuid := make([]byte, 16) - _, err := rand.Read(uuid) + id := make([]byte, 16) + _, err := rand.Read(id) if err != nil { panic(err) } - uuid[8] = uuid[8]&^0xc0 | 0x80 - uuid[6] = uuid[6]&^0xf0 | 0x40 - - return fmt.Sprintf("%x-%x-%x-%x-%x", uuid[0:4], uuid[4:6], uuid[6:8], uuid[8:10], uuid[10:]) + return fmt.Sprintf("%x", id) } -- cgit v1.2.3-70-g09d2