From 8482b07eed738e6147109318c600ef722d325239 Mon Sep 17 00:00:00 2001 From: qowevisa Date: Sat, 8 Jun 2024 21:58:51 +0300 Subject: [PATCH] Changes in encoding --- communication/protocol.go | 4 ++-- communication/types.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/communication/protocol.go b/communication/protocol.go index a3b2dc0..20e33b0 100644 --- a/communication/protocol.go +++ b/communication/protocol.go @@ -3,7 +3,7 @@ package communication import ( "bytes" "crypto/rand" - "encoding/base64" + "encoding/base32" "encoding/gob" "git.qowevisa.me/Qowevisa/gotell/gmyerr" @@ -138,7 +138,7 @@ func (r *RegisteredUser) GenerateLink(count uint16) (Link, error) { if err != nil { return Link{}, err } - encoded := base64.StdEncoding.EncodeToString(buf) + encoded := base32.StdEncoding.EncodeToString(buf) l.Status = LINK_STATUS_CREATED l.Data = []byte(encoded) l.UseCount = count diff --git a/communication/types.go b/communication/types.go index a9eb858..906e20c 100644 --- a/communication/types.go +++ b/communication/types.go @@ -16,7 +16,7 @@ const ( ) const ( - LINK_LEN_V1 = 32 + LINK_LEN_V1 = 8 ) // NOTE: Data should be 32 or 64 bytes