basic common app packages

This commit is contained in:
2025-06-16 22:19:00 +05:30
parent 8654f21b62
commit 0240ec154e
49 changed files with 5481 additions and 232 deletions

26
crypto/random_test.go Normal file
View File

@@ -0,0 +1,26 @@
// Copyright 2024 Patial Tech (Ankit Patial).
// All rights reserved.
package crypto
import (
"encoding/base64"
"fmt"
"testing"
)
func TestRandomBytes(t *testing.T) {
if key, err := RandomBytes(32); err != nil {
t.Error(err)
} else {
fmt.Println(base64.StdEncoding.EncodeToString(key))
}
}
func TestRandomBytesHex(t *testing.T) {
if key, err := RandomBytesHex(32); err != nil {
t.Error(err)
} else {
fmt.Println(key)
}
}