搜索
您的当前位置:首页正文

golang md5加密

来源:哗拓教育
package main

import (
    "crypto/md5"
    "encoding/hex"
    "fmt"
)

func main() {
    h := md5.New()
    h.Write([]byte("hello world"))
    cipherStr := h.Sum(nil)
    fmt.Println("*******加密*****", hex.EncodeToString(cipherStr)) // 输出加密结果
}

QQ20160802-0.png
Top