Skip to content

Commit

Permalink
add black2b sum
Browse files Browse the repository at this point in the history
  • Loading branch information
孙显松 committed Dec 14, 2020
1 parent 89d3a79 commit dbd9bef
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions crypto/blake2b.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package crypto

import "golang.org/x/crypto/blake2b"

// Blake2b256 blake2b.Sum256
func Blake2b256(msg []byte) []byte {
b := blake2b.Sum256(msg)
return b[:]
}

// Blake2b512 blake2b.Sum512
func Blake2b512(msg []byte) []byte {
b := blake2b.Sum512(msg)
return b[:]
}

// Blake2b384 blake2b.Sum384
func Blake2b384(msg []byte) []byte {
b := blake2b.Sum384(msg)
return b[:]
}

0 comments on commit dbd9bef

Please sign in to comment.