add other session providers (#5963)
This commit is contained in:
parent
bf4badad1d
commit
9de871a0f8
160 changed files with 37644 additions and 66 deletions
5
vendor/github.com/go-macaron/session/utils.go
generated
vendored
5
vendor/github.com/go-macaron/session/utils.go
generated
vendored
|
@ -50,11 +50,14 @@ func DecodeGob(encoded []byte) (out map[interface{}]interface{}, err error) {
|
|||
return out, err
|
||||
}
|
||||
|
||||
// NOTE: A local copy in case of underlying package change
|
||||
var alphanum = []byte("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")
|
||||
|
||||
// generateRandomKey creates a random key with the given strength.
|
||||
func generateRandomKey(strength int) []byte {
|
||||
k := make([]byte, strength)
|
||||
if n, err := io.ReadFull(rand.Reader, k); n != strength || err != nil {
|
||||
return com.RandomCreateBytes(strength)
|
||||
return com.RandomCreateBytes(strength, alphanum...)
|
||||
}
|
||||
return k
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue