udwCryptoSha3

package
v0.0.0-...-f254aa5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 8 Imported by: 5

Documentation

Overview

Example (Mac)
k := []byte("this is a secret key; you should generate a strong random key that's at least 32 bytes long")
buf := []byte("and this is some data to authenticate")

h := make([]byte, 32)
d := NewShake256()

d.Write(k)

d.Write(buf)

d.Read(h)
Output:

Example (Sum)
buf := []byte("some data to hash")

h := make([]byte, 64)

ShakeSum256(h, buf)
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlphaNumByString

func AlphaNumByString(inString string, returnLen int) string

func Float64ByString

func Float64ByString(inString string) float64
Example
rangeMap := map[float64]int{}
for i := 0; i < 800; i++ {
	out := Float64ByString(strconv.Itoa(i))
	thisRange := out - math.Mod(out, 1.0/16)
	rangeMap[thisRange]++
}
fmt.Println(len(rangeMap))
for thisRange, size := range rangeMap {
	fmt.Println(thisRange, size)
}
Output:

func GetSha3ShakeSum256RandomGenerater

func GetSha3ShakeSum256RandomGenerater(inString string) func(returnLen int) []byte

func IntnByString

func IntnByString(inString string, n int) int
Example
rangeMap := map[int]int{}
for i := 0; i < 1000; i++ {
	out := IntnByString(strconv.Itoa(i), 5)
	rangeMap[out]++
}
fmt.Println(len(rangeMap))
for thisRange, size := range rangeMap {
	fmt.Println(thisRange, size)
}
Output:

func MustSha3512File

func MustSha3512File(path string) (b []byte)

func New224

func New224() hash.Hash

func New256

func New256() hash.Hash

func New384

func New384() hash.Hash

func New512

func New512() hash.Hash

func NewGoRandByString

func NewGoRandByString(inString string) *rand.Rand

func Sha3512

func Sha3512(content []byte) []byte

func Sha3512File

func Sha3512File(path string) (string, error)

func Sha3512First16

func Sha3512First16(content []byte) []byte

func Sha3512ToHexString

func Sha3512ToHexString(content []byte) string

func Sha3512ToHexString32

func Sha3512ToHexString32(content []byte) string

func Sha3512ToHexStringFromString

func Sha3512ToHexStringFromString(content string) string

func ShakeSum128

func ShakeSum128(hash, data []byte)

func ShakeSum256

func ShakeSum256(hash, data []byte)

func Sum224

func Sum224(data []byte) (digest [28]byte)

func Sum256

func Sum256(data []byte) (digest [32]byte)

func Sum384

func Sum384(data []byte) (digest [48]byte)

func Sum512

func Sum512(data []byte) (digest [64]byte)

func Sum512Slice

func Sum512Slice(data []byte) (digest []byte)

Types

type ShakeHash

type ShakeHash interface {
	io.Writer

	io.Reader

	Clone() ShakeHash

	Reset()
}

func NewShake128

func NewShake128() ShakeHash

func NewShake256

func NewShake256() ShakeHash

Jump to

Keyboard shortcuts

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