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:
parent
401f66f15b
commit
c6a3c120c6
6 changed files with 144 additions and 60 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue