Files
llgo/_cmptest/md5demo/md5.go

21 lines
384 B
Go
Raw Normal View History

2024-07-30 01:35:49 +08:00
package main
import (
2024-07-31 18:59:25 +08:00
"crypto"
2024-07-30 01:35:49 +08:00
"crypto/md5"
"fmt"
"io"
)
func main() {
h := md5.New()
io.WriteString(h, "The fog is getting thicker!")
io.WriteString(h, "And Leon's getting laaarger!")
2024-07-31 18:59:25 +08:00
fmt.Printf("%x\n", h.Sum(nil))
h = crypto.MD5.New()
io.WriteString(h, "The fog is getting thicker!")
io.WriteString(h, "And Leon's getting laaarger!")
fmt.Printf("%x\n", h.Sum(nil))
2024-07-30 01:35:49 +08:00
}