Hash

package
v1.1.162 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

README

加密处理类

处理类型

  1. Aes
  2. Hash
  3. md5

文件说明

名称 所在目录 备注说明
aes CryptoHelper/EncryptAes/Aes.go aes 加密(java, php, go js(crypto-js) 通用版通用)
hash CryptoHelper/Hash.go hash26
md5 CryptoHelper/EncryptMd5/Md5.go md5 加密

使用案例:

  1. aes (java php go js(crypto-js) 通用版)

注) 在使用前,最好将代码数据两次base64

如:前端 将数据先处理base64 加密, 然后对base64进行aes , 后端: 先进行aes解密, 然后处理base64字符串

使用 cbc ZeroPadding, java 为: "AES/CBC/ZeroBytePadding"

向量和密钥为16个长度

str:="123456"
key:="1111111111111111"
iv :="1111111111111111"
aesEncryptBytes,_:= EncryptAes.AesEncrypt(key , iv , string)
aesEncrypt :=aesEncryptBytes
fmt.Println(aesEncrypt)
  1. hash
str:="1234565"
hashStr:=CryptoHelper.Hash256(str)
fmt.Println(hashStr)
  1. md5
str:="123456"
md5Str,_:=EncryptMd5.Md5(str)
fmt.Println(md5Str)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash256

func Hash256(str string) string

* 生成hash256

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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