Documentation
¶
Index ¶
Examples ¶
Constants ¶
const SHA256Size = 32
const SHA512Size = 64
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SHA256 ¶
type SHA256 []byte
func ParseSHA256Sum ¶
ParseSHA256Sum parses a hex encoded string of an SHA256 sum.
func SHA256Sum ¶
SHA256Sum returns the SHA256 checksum of data.
Example ¶
package main
import (
"fmt"
"git.gorbe.io/go/cryptography"
)
func main() {
d := []byte{0}
s := cryptography.SHA256Sum(d)
fmt.Printf("%s", s)
}
Output: 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d
func SHA256SumFile ¶
SHA256SumFile returns the SHA256 checksum of the file in path. Uses io.Copy() to be usable on large files.
func SHA256SumReader ¶
SHA256SumReader returns the SHA256 checksum of the data read from r. Uses io.Copy() to be usable on large files.
type SHA512 ¶
type SHA512 []byte
func ParseSHA512Sum ¶
ParseSHA512Sum parses a hex encoded string of an SHA512 sum.
func SHA512Sum ¶
SHA512Sum returns the SHA512 checksum of data.
Example ¶
package main
import (
"fmt"
"git.gorbe.io/go/cryptography"
)
func main() {
d := []byte{0}
s := cryptography.SHA512Sum(d)
fmt.Printf("%s", s)
}
Output: b8244d028981d693af7b456af8efa4cad63d282e19ff14942c246e50d9351d22704a802a71c3580b6370de4ceb293c324a8423342557d4e5c38438f0e36910ee
func SHA512SumFile ¶
SHA512SumFile returns the SHA512 checksum of the file in path. Uses io.Copy() to be usable on large files.
func SHA512SumReader ¶
SHA512SumReader returns the SHA512 checksum of the data read from r. Uses io.Copy() to be usable on large files.