crypto

package
v1.18.15 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Methods and types to support cryptographic operations.

Index

Constants

View Source
const HashLength = 32

Variables

This section is empty.

Functions

func Hash

func Hash(data interface{}) string

Hash computes hash of the given data using RawHash and returns result as hex decoded string.

func RawHash

func RawHash(data interface{}) []byte

RawHash computes SHA3-256 hash depending on data type and returns the hash bytes.

RawHash panics if data type is unknown.

Known types:

- []byte

- HashBytes

- string

Types

type HashBytes

type HashBytes [HashLength]byte

Jump to

Keyboard shortcuts

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