1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-14 18:10:53 +00:00

Switch to nacl cryptobox

This commit is contained in:
Kane York 2015-10-25 12:40:07 -07:00
parent 401f66f15b
commit c6a3c120c6
6 changed files with 144 additions and 60 deletions

View file

@ -1,8 +1,25 @@
package server
import (
"crypto/rand"
)
func FillCryptoRandom(buf []byte) error {
remaining := len(buf)
for remaining > 0 {
count, err := rand.Read(buf)
if err != nil {
return err
}
remaining -= count
}
return nil
}
func NewByteBuffer() interface{} {
return make([]byte, 1024)
}
func AddToSliceS(ary *[]string, val string) bool {
slice := *ary
for _, v := range slice {