Documentation ¶
Overview ¶
Package sha512 implements the SHA384 and SHA512 hash algorithms as defined in FIPS 180-2.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Digest ¶
Digest calculates the SHA-512 digest and returns the resulting slice.
Example ¶
package main import ( "fmt" "gopkg.in/goyy/goyy.v0/util/crypto/sha512" ) func main() { dst, _ := sha512.Digest([]byte("goyy")) fmt.Println(fmt.Sprintf("%x", dst)) }
Output: 1aa5692a60d265ec371f0f63e59deb0a3bfce9e07ec54de56b75aea9cb0a2ca96fd868d2866843bd0c9d82aa93a696ab557a6cbb57c22e16eab4bd2553198fad
func DigestHex ¶
DigestHex calculates the SHA-512 digest and returns the resulting hex string.
Example ¶
package main import ( "fmt" "gopkg.in/goyy/goyy.v0/util/crypto/sha512" ) func main() { dst, _ := sha512.DigestHex("goyy") fmt.Println(dst) }
Output: 1aa5692a60d265ec371f0f63e59deb0a3bfce9e07ec54de56b75aea9cb0a2ca96fd868d2866843bd0c9d82aa93a696ab557a6cbb57c22e16eab4bd2553198fad
func DigestSum ¶
DigestSum calculates the SHA-512 digest to sum and returns the resulting slice.
Example ¶
package main import ( "fmt" "gopkg.in/goyy/goyy.v0/util/crypto/sha512" ) func main() { dst, _ := sha512.DigestSum([]byte("goyy"), []byte("goyy:")) fmt.Println(fmt.Sprintf("%x", dst)) }
Output: 676f79793a1aa5692a60d265ec371f0f63e59deb0a3bfce9e07ec54de56b75aea9cb0a2ca96fd868d2866843bd0c9d82aa93a696ab557a6cbb57c22e16eab4bd2553198fad
func DigestSumHex ¶
DigestSumHex calculates the SHA-512 digest to sum and returns the resulting hex string.
Example ¶
package main import ( "fmt" "gopkg.in/goyy/goyy.v0/util/crypto/sha512" ) func main() { dst, _ := sha512.DigestSumHex("goyy", "goyy:") fmt.Println(dst) }
Output: 676f79793a1aa5692a60d265ec371f0f63e59deb0a3bfce9e07ec54de56b75aea9cb0a2ca96fd868d2866843bd0c9d82aa93a696ab557a6cbb57c22e16eab4bd2553198fad
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.