go知识重新整理

This commit is contained in:
Estom
2021-09-03 05:34:34 +08:00
parent 62309f856a
commit 1bad082e49
291 changed files with 29345 additions and 2 deletions

13
Go/gopkg/crypto/md5.go Normal file
View File

@@ -0,0 +1,13 @@
package main
import (
"crypto/md5"
"fmt"
"io"
)
func main() {
h := md5.New()
io.WriteString(h, "demo")
fmt.Printf("%x\n", h.Sum(nil)) // New() Sum()
}

13
Go/gopkg/crypto/sha256.go Normal file
View File

@@ -0,0 +1,13 @@
package main
import (
"crypto/sha256"
"fmt"
"io"
)
func main() {
h := sha256.New()
io.WriteString(h, "demo")
fmt.Printf("%x\n", h.Sum(nil))
}