This commit is contained in:
Sangeeth Sudheer 2024-05-03 00:05:14 +05:30
parent a415d888f1
commit 8d8b00ba83
Signed by: x
GPG Key ID: F6D06ECE734C57D1
2 changed files with 17 additions and 2 deletions

View File

@ -31,7 +31,8 @@ package main
// import "git.sangeeth.dev/gobyexample/time" // import "git.sangeeth.dev/gobyexample/time"
// import "git.sangeeth.dev/gobyexample/rand" // import "git.sangeeth.dev/gobyexample/rand"
// import "git.sangeeth.dev/gobyexample/numberparsing" // 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() { func main() {
// runes.Runes() // runes.Runes()
@ -65,5 +66,6 @@ func main() {
// time.Time() // time.Time()
// rand.Rand() // rand.Rand()
// numberparsing.NumberParsing() // numberparsing.NumberParsing()
url.Url() // url.Url()
sha.Sha()
} }

13
sha/sha.go Normal file
View 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))
}