// Copyright 2020 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.packagecryptoutilimport("crypto/md5""encoding/hex")// MD5 encodes string to hexadecimal of MD5 checksum.funcMD5(strstring)string{returnhex.EncodeToString(MD5Bytes(str))}// MD5Bytes encodes string to MD5 checksum.funcMD5Bytes(strstring)[]byte{m:=md5.New()_,_=m.Write([]byte(str))returnm.Sum(nil)}