Documentation ¶
Index ¶
Constants ¶
View Source
const BLAKE2B = 0x40
View Source
const BLAKE2S = 0x41
View Source
const SHA1 = 0x11
constants
View Source
const SHA2_256 = 0x12
View Source
const SHA2_512 = 0x13
View Source
const SHA3 = 0x14
Variables ¶
View Source
var Codes = map[int]string{
0x11: "sha1",
0x12: "sha2-256",
0x13: "sha2-512",
0x14: "sha3",
0x40: "blake2b",
0x41: "blake2s",
}
View Source
var DefaultLengths = map[int]int{
0x11: 20,
0x12: 32,
0x13: 64,
0x14: 64,
0x40: 64,
0x41: 32,
}
View Source
var Names = map[string]int{
"sha1": 0x11,
"sha2-256": 0x12,
"sha2-512": 0x13,
"sha3": 0x14,
"blake2b": 0x40,
"blake2s": 0x41,
}
Functions ¶
Types ¶
type DecodedMultihash ¶
func Decode ¶
func Decode(buf []byte) (*DecodedMultihash, error)
Decodes a hash from the given Multihash.
Click to show internal directories.
Click to hide internal directories.