merge with master
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
commit
2b8bd28158
25 files changed
+233
-386
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"errors"
|
||||
"os"
|
||||
|
||||
@@ -80,3 +81,11 @@ func getDB() *storm.DB {
|
||||
func getStorage(db *storm.DB) *storage.Storage {
|
||||
return bolt.NewStorage(db)
|
||||
}
|
||||
|
||||
func generateRandomBytes(n int) []byte {
|
||||
b := make([]byte, n)
|
||||
_, err := rand.Read(b)
|
||||
checkErr(err)
|
||||
// Note that err == nil only if we read len(b) bytes.
|
||||
return b
|
||||
}
|
||||
Reference in new issue
Block a user