mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 23:17:19 +00:00
add personal access token panel #12
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user