sha256_128

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Size 输出大小 (16 字节 / 128 位)
	Size = 16
)

Variables

This section is empty.

Functions

func Sum

func Sum(data []byte) []byte

Sum 计算 SHA256-128 哈希值 (截断至 128 位)

func SumHex

func SumHex(data []byte) string

SumHex 计算 SHA256-128 哈希并返回十六进制字符串

func SumString

func SumString(s string) []byte

SumString 计算字符串的 SHA256-128 哈希

func SumStringHex

func SumStringHex(s string) string

SumStringHex 计算字符串的 SHA256-128 哈希并返回十六进制字符串

func Verify

func Verify(data, expected []byte) bool

Verify 验证数据的 SHA256-128 哈希值

Types

type SHA256_128Hasher

type SHA256_128Hasher struct{}

SHA256_128Hasher SHA256-128 哈希器

func NewSHA256_128Hasher

func NewSHA256_128Hasher() *SHA256_128Hasher

NewSHA256_128Hasher 创建 SHA256-128 哈希器

func (*SHA256_128Hasher) Sum

func (h *SHA256_128Hasher) Sum(data []byte) []byte

Sum 计算 SHA256-128 哈希值

func (*SHA256_128Hasher) SumHex

func (h *SHA256_128Hasher) SumHex(data []byte) string

SumHex 计算 SHA256-128 哈希并返回十六进制字符串

func (*SHA256_128Hasher) Type

Type 返回校验类型

Jump to

Keyboard shortcuts

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