Simple hashing in Go https://pkg.go.dev/github.com/annybs/go-hash

Aneurin Barker Snook e8c7f6c645 add test workflow 1 năm trước cách đây
.github e8c7f6c645 add test workflow 1 năm trước cách đây
.gitignore b6214b3f10 ensure go.sum not committed 1 năm trước cách đây
LICENSE.md b53fd7de75 duplicate license to each package 1 năm trước cách đây
README.md 0e71b8ce58 fix link to license 1 năm trước cách đây
go.mod c1f1fe029a rename package 1 năm trước cách đây
hash.go 0aed2fb5d8 add readme for each package 1 năm trước cách đây
hash_test.go 9469d0f61a add simple hash functions, tests 1 năm trước cách đây

README.md

Go Hash

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.

Example

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.

License

See LICENSE.md