library: crypto

This commit is contained in:
xushiwei
2024-07-31 18:59:25 +08:00
parent 27677f86e4
commit 85509c777d
2 changed files with 8 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
package main
import (
"crypto"
"crypto/md5"
"fmt"
"io"
@@ -10,5 +11,10 @@ func main() {
h := md5.New()
io.WriteString(h, "The fog is getting thicker!")
io.WriteString(h, "And Leon's getting laaarger!")
fmt.Printf("%x", h.Sum(nil))
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))
}