hash

package module
v0.0.0-...-9fdfb43 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 3 Imported by: 0

README

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.

⚠ This package has been retracted. Use github.com/annybs/go-hash instead.

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SHA256

func SHA256(value string) string

SHA256 creates a hex-encoded SHA256 checksum for a string input.

func SHA512

func SHA512(value string) string

SHA512 creates a hex-encoded SHA512 checksum for a string input.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL