x8r16

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: ISC Imports: 16 Imported by: 0

Documentation

Index

Examples

Constants

View Source
const (
	BLAKE = iota
	BMW
	JH
	KECCAK
	SKEIN
	LUFFA
	HAMSI
	SHABAL
	HASH_FUNC_COUNT
)
View Source
const X8R16_LOOP_CNT = 16

Variables

This section is empty.

Functions

func Sum256

func Sum256(in []byte) [32]byte

func Sum512

func Sum512(in []byte) [64]byte

Types

type Hash

type Hash struct {
	// contains filtered or unexported fields
}

Hash contains the state objects required to perform the x16.Hash.

func New

func New() *Hash

New returns a new object to compute a x16 hash.

Example
package main

import (
	"encoding/hex"
	"fmt"
	"github.com/Qitmeer/qitmeer/crypto/x8r16"
)

func main() {
	b := []byte("helloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhel")
	h := x8r16.New()
	out := make([]byte, 32)
	h.Hash(b, out)
	fmt.Printf(hex.EncodeToString(out))
}
Output:

52ac0c51e33f308f838998528d492cb135162a90f235121a65033f143c214a16

func (*Hash) Hash

func (ref *Hash) Hash(src []byte, dst []byte)

Hash computes the hash from the src bytes and stores the result in dst.

Jump to

Keyboard shortcuts

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