mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 04:09:40 -06:00
Bumps [github.com/gookit/config/v2](https://github.com/gookit/config) from 2.1.8 to 2.2.2. - [Release notes](https://github.com/gookit/config/releases) - [Commits](https://github.com/gookit/config/compare/v2.1.8...v2.2.2) --- updated-dependencies: - dependency-name: github.com/gookit/config/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
20 lines
318 B
Go
20 lines
318 B
Go
// Package byteutil Provide some bytes utils functions or structs
|
|
package byteutil
|
|
|
|
import (
|
|
"crypto/md5"
|
|
"fmt"
|
|
)
|
|
|
|
// Md5 Generate a 32-bit md5 bytes
|
|
func Md5(src any) []byte {
|
|
h := md5.New()
|
|
|
|
if s, ok := src.(string); ok {
|
|
h.Write([]byte(s))
|
|
} else {
|
|
h.Write([]byte(fmt.Sprint(src)))
|
|
}
|
|
return h.Sum(nil)
|
|
}
|