aboutsummaryrefslogtreecommitdiff
path: root/securecookie.go
diff options
context:
space:
mode:
authorKamil Kisiel <kamil@kamilkisiel.net>2014-11-20 20:07:42 +0300
committerKamil Kisiel <kamil@kamilkisiel.net>2014-11-20 20:07:42 +0300
commitf0559d009e6943011cd1ba6eb16195cf5e0ed326 (patch)
treefe3fb88a93b0321f038454a38ecf9ec2451918b3 /securecookie.go
parent1b0c7f6e9ab3d7f500fd7d50c7ad835ff428139b (diff)
parent0ff019e2d61cc28e13bb9376ff503ceeba935239 (diff)
Merge pull request #11 from dominikh/master
say that we create a key of a certain length, not strength
Diffstat (limited to 'securecookie.go')
-rw-r--r--securecookie.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/securecookie.go b/securecookie.go
index 74b8acc..6b70268 100644
--- a/securecookie.go
+++ b/securecookie.go
@@ -340,9 +340,9 @@ func decode(value []byte) ([]byte, error) {
// Helpers --------------------------------------------------------------------
-// GenerateRandomKey creates a random key with the given strength.
-func GenerateRandomKey(strength int) []byte {
- k := make([]byte, strength)
+// GenerateRandomKey creates a random key with the given length in bytes.
+func GenerateRandomKey(length int) []byte {
+ k := make([]byte, length)
if _, err := io.ReadFull(rand.Reader, k); err != nil {
return nil
}