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