Shembull: Gjenerimi i sha256 hash
1 package main
2
3 import (
4 "crypto/sha256"
5 "fmt"
6 )
7
8 func main() {
9 teksti := "Lorem Ipsum dolor sit Amet"
10 sha_256 := sha256.New()
11 sha_256.Write([]byte(teksti))
12
13 fmt.Printf("Teksti:\t\t%v\n", teksti)
14 fmt.Printf("sha256:\t\t%x\n", sha_256.Sum(nil))
15
16 }
https://play.golang.org/p/sGbSxbLLTVS
Rezultati:
Teksti: Lorem Ipsum dolor sit Amet
sha256: eb7a03c377c28da97ae97884582e6bd07fa44724af99798b42593355e39f82cb