Add sha
This commit is contained in:
parent
a415d888f1
commit
8d8b00ba83
6
main.go
6
main.go
@ -31,7 +31,8 @@ package main
|
||||
// import "git.sangeeth.dev/gobyexample/time"
|
||||
// import "git.sangeeth.dev/gobyexample/rand"
|
||||
// import "git.sangeeth.dev/gobyexample/numberparsing"
|
||||
import "git.sangeeth.dev/gobyexample/url"
|
||||
// import "git.sangeeth.dev/gobyexample/url"
|
||||
import "git.sangeeth.dev/gobyexample/sha"
|
||||
|
||||
func main() {
|
||||
// runes.Runes()
|
||||
@ -65,5 +66,6 @@ func main() {
|
||||
// time.Time()
|
||||
// rand.Rand()
|
||||
// numberparsing.NumberParsing()
|
||||
url.Url()
|
||||
// url.Url()
|
||||
sha.Sha()
|
||||
}
|
||||
|
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))
|
||||
}
|
Loading…
Reference in New Issue
Block a user