Quantcast
Channel: CodeSection,代码区,网络安全 - CodeSec
Viewing all articles
Browse latest Browse all 12749

golang中crypto/md5包

0
0

md5包实现了MD5哈希算法

先介绍这个包内里的内容,然后再给出生成一个md5值,go使用md5比较复杂很多,php的话,就直接md5(值),就生成md5值了,php更加适合用于生产,而不是学习。

常量

const BlockSize = 64 // MD5字节块大小 const Size = 16 // MD5校验和字节数 func Sum(data []byte) [Size]byte

返回数据data的MD5校验和

func New() hash.Hash

返回一个新的使用MD5校验的hash.Hash接口

h := md5.New() h.Write([]byte("123456")) fmt.Println(h.BlockSize())

Viewing all articles
Browse latest Browse all 12749

Latest Images

Trending Articles





Latest Images