Source File
multihash_blake2.go
Belonging Package
github.com/multiformats/go-multihash/register/blake2
/*This package has no purpose except to perform registration of multihashes.It is meant to be used as a side-effecting import, e.g.import (_ "github.com/multiformats/go-multihash/register/blake2")This package registers several multihashes for the blake2 family(both the 's' and the 'b' variants, and in a variety of sizes).*/package blake2import (multihash)const (blake2b_min = 0xb201blake2b_max = 0xb240blake2s_min = 0xb241blake2s_max = 0xb260)func init() {// blake2s// This package only enables support for 32byte (256 bit) blake2s.multihash.Register(blake2s_min+31, func() hash.Hash {, := blake2s.New256(nil)if != nil {panic()}return})// blake2b// There's a whole range of these.for := uint64(blake2b_min); <= blake2b_max; ++ {:= int( - blake2b_min + 1)multihash.Register(, func() hash.Hash {, := blake2b.New(, nil)if != nil {panic()}return})}}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |