# crypto.MD5
> 返回给定输入的 MD5 校验和，并编码为十六进制字符串。
- 官方英文原文：https://gohugo.io/functions/crypto/md5/
- 本页规范地址：https://hugozh.cn/functions/crypto/md5/
- 最近更新：2026-10-02
- 最后提交：912b1d3 chore(site): 添加 static/CNAME（hugozh.cn），供 GitHub Pages 等平台绑定自定义域名
- 签名：crypto.MD5 INPUT
- 返回类型：string
- 站点：Hugo 中文文档（https://hugozh.cn/）· 社区维护的非官方中文翻译，如有出入以官方英文原文为准

---
```go-html-template
{{ md5 "Hello world" }} → 3e25960a79dbc69b674cd4ec67a72c62
```

如果你想用 [Gravatar][] 生成唯一头像，这个函数会很有用：

```html
<img src="https://www.gravatar.com/avatar/{{ md5 "your@email.com" }}?s=100&d=identicon">
```

[Gravatar]: https://en.gravatar.com/

