Skip to content

Commit

Permalink
Issue #4 - Made GetNonce func private
Browse files Browse the repository at this point in the history
In crypto/crypto.go
  Updated GetNonce function, and function call, to be private.
  • Loading branch information
keyslapperdev committed Dec 2, 2020
1 parent 4fbed2c commit 2ada86e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func Encrypt(password string, salt, data []byte) ([]byte, error) {
if err != nil {
return nil, err
}
nonce, err := GetNonce(gcm.NonceSize())
nonce, err := getNonce(gcm.NonceSize())
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -73,7 +73,7 @@ func RandomBytes(length int) []byte {
return b
}

func GetNonce(length int) ([]byte, error) {
func getNonce(length int) ([]byte, error) {
nonce := make([]byte, length)

_, err := io.ReadFull(cryrand.Reader, nonce)
Expand Down

0 comments on commit 2ada86e

Please sign in to comment.