add personal access token panel #12

This commit is contained in:
Unknwon 2014-11-12 06:48:50 -05:00
parent 21b9d5fa1f
commit 8c9338a537
20 changed files with 311 additions and 62 deletions

View file

@ -33,6 +33,13 @@ func EncodeMd5(str string) string {
return hex.EncodeToString(m.Sum(nil))
}
// Encode string to sha1 hex value.
func EncodeSha1(str string) string {
h := sha1.New()
h.Write([]byte(str))
return hex.EncodeToString(h.Sum(nil))
}
func BasicAuthDecode(encoded string) (user string, name string, err error) {
var s []byte
s, err = base64.StdEncoding.DecodeString(encoded)