// Package md5 provides MD5 digest helpers. package md5 import ( "github.com/gogf/gf/v2/crypto/gmd5" ) // Md5Hex returns the MD5 digest of s as a lowercase hex string. // The underlying error is ignored because it never fails for in-memory input. func Md5Hex(s string) string { h, _ := gmd5.EncryptString(s) return h } // Md5Bytes returns the MD5 digest of data as a lowercase hex string. func Md5Bytes(data []byte) (string, error) { return gmd5.Encrypt(data) } // Md5File returns the MD5 digest of the local file at path as a hex string. func Md5File(path string) (string, error) { return gmd5.EncryptFile(path) }