feat(tfstated): implement GET and POST methods, states are encrypted in a sqlite3 database

This commit is contained in:
Julien Dessaux 2024-09-30 00:58:49 +02:00
parent baf5aac08e
commit 4ff490806c
Signed by: adyxax
GPG key ID: F92E51B86E07177E
18 changed files with 627 additions and 2 deletions

16
pkg/scrypto/random.go Normal file
View file

@ -0,0 +1,16 @@
package scrypto
import (
"crypto/rand"
"fmt"
)
func RandomBytes(n int) []byte {
data := make([]byte, n)
if _, err := rand.Read(data); err != nil {
panic(fmt.Sprintf("cannot generate random data: %+v", err))
}
return data
}