util

package
v0.0.0-...-7c645d9 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

默克尔树

Package ripemd160 implements the RIPEMD-160 hash algorithm.

Deprecated: RIPEMD-160 is a legacy hash and should not be used for new applications. Also, this package does not and will not provide an optimized implementation. Instead, use a modern hash like SHA-256 (from crypto/sha256).

Index

Constants

View Source
const BlockSize = 64

The block size of the hash algorithm in bytes.

View Source
const Size = 20

The size of the checksum in bytes.

Variables

This section is empty.

Functions

func Base58Decode

func Base58Decode(input []byte) []byte

base58解码

func Base58Encode

func Base58Encode(input []byte) []byte

base58编码

func BytesToInt

func BytesToInt(bys []byte) int

字节数组转换为int

func GenerateRealRandom

func GenerateRealRandom() int64

生成随机数

func Int64ToBytes

func Int64ToBytes(i int64) []byte

int64转换成字节数组

func NewRipemd160

func NewRipemd160() hash.Hash

New returns a new hash.Hash computing the checksum.

func RandomInRange

func RandomInRange(min int, max int) int

func Uint64Pow

func Uint64Pow(n, m uint64) uint64

func Uint64ToBytes

func Uint64ToBytes(i uint64) []byte

int64转换成字节数组

Types

type MerkelNode

type MerkelNode struct {
	Left  *MerkelNode
	Right *MerkelNode
	Data  []byte
}

func BuildMerkelNode

func BuildMerkelNode(left, right *MerkelNode, data []byte) MerkelNode

type MerkelTree

type MerkelTree struct {
	MerkelRootNode *MerkelNode
}

func NewMerkelTree

func NewMerkelTree(data [][]byte) *MerkelTree

Jump to

Keyboard shortcuts

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