1
0
Fork
You've already forked identicon
0
(WIP/Proposal) The forked identicon library for use in Gitea. Currently a mirror of: https://piramisancchi.live-on.net:9175/gitea/identicon
Go 100%
2021年04月10日 05:40:30 +02:00
.github/workflows ci: 添加对 go1.16 的支持 2021年02月22日 13:29:37 +08:00
screenshot 更新README.md 2015年05月23日 21:00:30 +08:00
testdata 更新文档 2017年06月30日 20:43:51 +08:00
.gitignore 更新测试到 go1.13 2019年09月06日 20:42:15 +08:00
block.go Redesign some blocks and delete one block 2021年04月10日 05:40:30 +02:00
doc.go docs: 调整文件头 2020年02月02日 21:13:23 +08:00
go.mod build: 更新引用版本 2020年12月14日 23:56:02 +08:00
go.sum build: 更新引用版本 2020年12月14日 23:56:02 +08:00
identicon.go Merge upstream changes with new ideas 2021年04月09日 10:44:55 +02:00
identicon_test.go Merge upstream changes with new ideas 2021年04月09日 10:44:55 +02:00
LICENSE Initial commit 2015年05月19日 17:15:25 +08:00
polygon.go Merge upstream changes with new ideas 2021年04月09日 10:44:55 +02:00
README.md More tweaks to blocks and combining logics 2021年04月08日 00:28:05 +02:00

identicon

根据用户的 IP 、邮箱名等任意数据为用户产生漂亮的随机头像。

// 根据用户访问的IP,为其生成一张头像img,_:=identicon.Make(128,color.NRGBA{},color.NRGBA{},[]byte("192.168.1.1"))fi,_:=os.Create("/tmp/u1.png")png.Encode(fi,img)fi.Close()// 或者ii,_:=identicon.New(128,color.NRGBA{},color.NRGBA{},color.NRGBA{},color.NRGBA{})img:=ii.Make([]byte("192.168.1.1"))img=ii.Make([]byte("192.168.1.2"))

版权

本项目采用 MIT 开源授权许可证,完整的授权说明可在 LICENSE 文件中找到。