feat(tfstated): implement GET and POST methods, states are encrypted in a sqlite3 database
This commit is contained in:
parent
baf5aac08e
commit
4ff490806c
18 changed files with 627 additions and 2 deletions
16
pkg/scrypto/random.go
Normal file
16
pkg/scrypto/random.go
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue