1
0
Fork 0
forked from forgejo/forgejo

Merge utils to modules

This commit is contained in:
Unknown 2014-03-07 17:22:15 -05:00
parent a2a59f8ad1
commit 5a05d6633d
14 changed files with 30 additions and 30 deletions

17
modules/base/tool.go Normal file
View file

@ -0,0 +1,17 @@
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package base
import (
"crypto/md5"
"encoding/hex"
)
// Encode string to md5 hex value
func EncodeMd5(str string) string {
m := md5.New()
m.Write([]byte(str))
return hex.EncodeToString(m.Sum(nil))
}