Skip to content
Go 语言版 identicon 头像产生工具
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
screenshot
testdata
.gitignore
.travis.yml 更新测试到 go1.13 Sep 6, 2019
LICENSE Initial commit May 19, 2015
README.md
block.go
doc.go 更新文档 Jun 30, 2017
go.mod
go.sum 更新测试到 go1.13 Sep 6, 2019
identicon.go
identicon_test.go
polygon.go

README.md

identicon Build Status

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

screenhost.1 screenhost.4 screenhost.5 screenhost.6 screenhost.7

// 根据用户访问的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"))

安装

go get github.com/issue9/identicon

文档

Go Walker GoDoc

版权

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

You can’t perform that action at this time.