Skip to content

Commit

Permalink
example: blake3 hash using github.com/zeebo/blake3
Browse files Browse the repository at this point in the history
  • Loading branch information
pilinux committed Aug 29, 2024
1 parent 563401a commit 6b3a87e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions _example/hashing/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"golang.org/x/crypto/blake2b"
"golang.org/x/crypto/sha3"
// "github.com/zeebo/blake3"
)

/*
Expand Down Expand Up @@ -111,4 +112,24 @@ func main() {
fmt.Println(blake2b512Sum)
fmt.Printf("hex: %x\n", blake2b512Sum)
fmt.Println("length", len(blake2b512Sum))
fmt.Println("")

// calculate BLAKE3-256 hash
/*
blake3Hash256 := blake3.Sum256(data)
fmt.Println("blake3Hash256:")
fmt.Println(blake3Hash256)
fmt.Printf("hex: %x\n", blake3Hash256)
fmt.Println("length", len(blake3Hash256))
fmt.Println("")
*/

// calculate BLAKE3-512 hash
/*
blake3Hash512 := blake3.Sum512(data)
fmt.Println("blake3Hash512:")
fmt.Println(blake3Hash512)
fmt.Printf("hex: %x\n", blake3Hash512)
fmt.Println("length", len(blake3Hash512))
*/
}

0 comments on commit 6b3a87e

Please sign in to comment.