easyhash

package
v0.0.0-...-5c98b36 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MulanPSL-2.0 Imports: 6 Imported by: 0

README

easyhash 哈希散列

包装标准库的方法,简化操作步骤,使一步完成哈希操作。

只需一行代码就可以获取 MD5 或 BLAKE2B 哈希结果。

示例:

package main

import (
    "gitee.com/sillyman/simpleUtil/common/easyhash"
    "fmt"
)

func main(){
    hashRes := easyhash.BLAKE2b256("岳阳小罗", []byte("secure_salt"))
    fmt.Println(hashRes)
    // output: a7cd5573ea38d1d7557ea5ae0f6a1149ca17175a6888701d9c2545a7e41c242b
}

Documentation

Overview

Package easyhash 包装哈希散列方法,使其一步完成

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BLAKE2b256

func BLAKE2b256(s string, salt []byte) string

BLAKE2b256 使用 crypto.BLAKE2b_256 进行哈希

func EasyHash

func EasyHash(h hash.Hash, r io.Reader, salt []byte) ([]byte, error)

EasyHash 使用指定的哈希算法 crypto.BLAKE2b_256 是速度和安全性非常好哈希算法,推荐使用

func GMSM3

func GMSM3(s string, salt []byte) string

GMSM3 国密 sm3 哈希

func Hex2Str

func Hex2Str(data []byte) string

func MD5

func MD5(s string, salt []byte) string

MD5

func MustEasyHash

func MustEasyHash(h hash.Hash, r io.Reader, salt []byte) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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