zcrypto

package
v0.0.0-...-49fafbb Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 12 Imported by: 11

Documentation

Overview

Package zcrypto implements cryptographic helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(h hash.Hash, value string) string

Hash returns the base-16 encoded string of value hashed with h.

func HashFile

func HashFile(filename string) (string, error)

HashFile creates a SHA-256 hash for a file, as "sha256-hash".

func Secret128

func Secret128() string

Secret number of 128 bits formatted in base36 (~25 bytes).

func Secret192

func Secret192() string

Secret number of 192 bits formatted in base36 (~38 bytes).

func Secret256

func Secret256() string

Secret number of 256 bits formatted in base36 (~48 bytes).

func Secret64

func Secret64() string

Secret number of 64 bits formatted in base36 (~12 bytes).

func SecretString

func SecretString(size int, sel string) string

Secret string of size characters selected from sel.

If sel is "" it will use [0-9a-zA-Z], excluding some easily confused characters: 0, 1, i, l, o, I, and O.

func VerifyHash

func VerifyHash(filename, hash string) (bool, error)

VerifyHash verifies a file with a hash from HashFile().

Types

This section is empty.

Jump to

Keyboard shortcuts

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