You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
462 B
Go
25 lines
462 B
Go
//////////////////////////////////////////////////////////////////////
|
|
//
|
|
// DO NOT EDIT THIS PART
|
|
// Your task is to edit `main.go`
|
|
//
|
|
|
|
package main
|
|
|
|
import (
|
|
"crypto/rand"
|
|
"encoding/base64"
|
|
"io"
|
|
)
|
|
|
|
// MakeSessionID is used to generate a random dummy sessionID
|
|
func MakeSessionID() (string, error) {
|
|
buf := make([]byte, 26)
|
|
_, err := io.ReadFull(rand.Reader, buf)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
|
|
return base64.StdEncoding.EncodeToString(buf), nil
|
|
}
|