Inital commit

This commit is contained in:
2022-02-24 01:07:09 +13:00
commit 8bc3cee328
55 changed files with 2292 additions and 0 deletions

20
misc/rand/rand.go Normal file
View File

@@ -0,0 +1,20 @@
package rand
import (
"crypto/rand"
"git.1248.nz/1248/Otfe/misc/b64"
)
//Bytes generates an random set of bytes n long
func Bytes(n int) ([]byte, error) {
b := make([]byte, n)
_, err := rand.Read(b)
return b, err
}
//B64String generates a base 64 string n bytess long
func B64String(n int) (string, error) {
b, err := Bytes(n)
return b64.Encode(string(b)), err
}