// 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/sha1""crypto/sha256""encoding/hex")// SHA1 encodes string to hexadecimal of SHA1 checksum.funcSHA1(strstring)string{h:=sha1.New()_,_=h.Write([]byte(str))returnhex.EncodeToString(h.Sum(nil))}// SHA256 encodes string to hexadecimal of SHA256 checksum.funcSHA256(strstring)string{h:=sha256.New()_,_=h.Write([]byte(str))returnhex.EncodeToString(h.Sum(nil))}