Add sha
This commit is contained in:
13
sha/sha.go
Normal file
13
sha/sha.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package sha
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func Sha() {
|
||||
h := sha256.New()
|
||||
h.Write([]byte("hello world!"))
|
||||
|
||||
fmt.Printf("SHA256 hash of 'hello world!': %x\n", h.Sum(nil))
|
||||
}
|
||||
Reference in New Issue
Block a user