Source File
crypto.go
Belonging Package
crypto
package crypto
import (
)
func ( Hash) () Hash {
return
}
func ( Hash) () string {
switch {
case MD4:
return "MD4"
case MD5:
return "MD5"
case SHA1:
return "SHA-1"
case SHA224:
return "SHA-224"
case SHA256:
return "SHA-256"
case SHA384:
return "SHA-384"
case SHA512:
return "SHA-512"
case MD5SHA1:
return "MD5+SHA1"
case RIPEMD160:
return "RIPEMD-160"
case SHA3_224:
return "SHA3-224"
case SHA3_256:
return "SHA3-256"
case SHA3_384:
return "SHA3-384"
case SHA3_512:
return "SHA3-512"
case SHA512_224:
return "SHA-512/224"
case SHA512_256:
return "SHA-512/256"
case BLAKE2s_256:
return "BLAKE2s-256"
case BLAKE2b_256:
return "BLAKE2b-256"
case BLAKE2b_384:
return "BLAKE2b-384"
case BLAKE2b_512:
return "BLAKE2b-512"
default:
return "unknown hash value " + strconv.Itoa(int())
}
}
const (
MD4 Hash = 1 + iota // import golang.org/x/crypto/md4
MD5 // import crypto/md5
SHA1 // import crypto/sha1
SHA224 // import crypto/sha256
SHA256 // import crypto/sha256
SHA384 // import crypto/sha512
SHA512 // import crypto/sha512
MD5SHA1 // no implementation; MD5+SHA1 used for TLS RSA
RIPEMD160 // import golang.org/x/crypto/ripemd160
SHA3_224 // import golang.org/x/crypto/sha3
SHA3_256 // import golang.org/x/crypto/sha3
SHA3_384 // import golang.org/x/crypto/sha3
SHA3_512 // import golang.org/x/crypto/sha3
SHA512_224 // import crypto/sha512
SHA512_256 // import crypto/sha512
BLAKE2s_256 // import golang.org/x/crypto/blake2s
BLAKE2b_256 // import golang.org/x/crypto/blake2b
BLAKE2b_384 // import golang.org/x/crypto/blake2b
BLAKE2b_512 // import golang.org/x/crypto/blake2b
maxHash
)
var digestSizes = []uint8{
MD4: 16,
MD5: 16,
SHA1: 20,
SHA224: 28,
SHA256: 32,
SHA384: 48,
SHA512: 64,
SHA512_224: 28,
SHA512_256: 32,
SHA3_224: 28,
SHA3_256: 32,
SHA3_384: 48,
SHA3_512: 64,
MD5SHA1: 36,
RIPEMD160: 20,
BLAKE2s_256: 32,
BLAKE2b_256: 32,
BLAKE2b_384: 48,
BLAKE2b_512: 64,
}
type PublicKey interface{}
type PrivateKey interface{}
Public() PublicKey
HashFunc() Hash
}
Public() PublicKey
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin 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 @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |