diff pkg/common/random.go @ 1345:6a021108410b

Finished the doc strings for the common package.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 26 Nov 2018 11:30:28 +0100
parents 515815565bd0
children 810b28f59b8b
line wrap: on
line diff
--- a/pkg/common/random.go	Mon Nov 26 11:15:52 2018 +0100
+++ b/pkg/common/random.go	Mon Nov 26 11:30:28 2018 +0100
@@ -21,6 +21,8 @@
 	"math/big"
 )
 
+// GenerateRandomKey generates a cryptographically secure random key
+// of a given length.
 func GenerateRandomKey(length int) []byte {
 	k := make([]byte, length)
 	if _, err := io.ReadFull(rand.Reader, k); err != nil {
@@ -29,6 +31,9 @@
 	return k
 }
 
+// RandomString generates a cryptographically secure password
+// of a given length which consists of alpha numeric characters
+// and at least one 'special' one.
 func RandomString(n int) string {
 
 	const (