Simple hashing in Go https://pkg.go.dev/github.com/annybs/go-hash
|
vor 10 Monaten | |
---|---|---|
.github | vor 10 Monaten | |
.gitignore | vor 10 Monaten | |
LICENSE.md | vor 11 Monaten | |
README.md | vor 10 Monaten | |
go.mod | vor 10 Monaten | |
hash.go | vor 11 Monaten | |
hash_test.go | vor 1 Jahr |
Simple wrapper functions which take arbitrary string input and return string hashes in hex encoding.
The author is aware that this package is somewhat perfunctory, but likes not having to think about the crypto
packages.
package main
import (
"errors"
"fmt"
"os"
"github.com/annybs/go/hash"
)
func main() {
if len(os.Args) < 2 {
fmt.Println(errors.New("input required"))
os.Exit(1)
}
fmt.Println(hash.SHA256(os.Args[1]))
}
Execute go run main.go "any test string you like"
to create SHA256 output.
See LICENSE.md