Update github.com/issue9/identicon from untagged to v1.0.1 (#11359)

Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
6543 2020-05-10 12:23:17 +02:00 committed by GitHub
parent dbb74978f7
commit 57b6f83191
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 67 additions and 51 deletions

View file

@ -2,14 +2,14 @@
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
// 一个基于hash值生成随机图像的包。
// Package identicon 一个基于 hash 值生成随机图像的包。
//
// 关于identicon并没有统一的标准一般用于在用户注册时
// 取用户的邮箱或是访问IP等数据(也可以是其它任何数据)
// 进行hash运算之后根据hash数据产生一张图像
// identicon 并没有统一的标准,一般用于在用户注册时,
// 取用户的邮箱或是访问 IP 等数据(也可以是其它任何数据)
// 进行 hash 运算,之后根据 hash 数据,产生一张图像,
// 这样即可以为用户产生一张独特的头像,又不会泄漏用户的隐藏。
//
// 在identicon中把图像分成以下九个部分:
// 在 identicon 中,把图像分成以下九个部分:
// -------------
// | 1 | 2 | 3 |
// -------------
@ -17,11 +17,11 @@
// -------------
// | 7 | 8 | 9 |
// -------------
// 其中1、3、9、7为不同角度(依次增加90度)的同一张图片,
// 2、6、8、4也是如此,这样可以保持图像是对称的,比较美观。
// 5则单独使用一张图片。
// 其中 1、3、9、7 为不同角度(依次增加 90 度)的同一张图片,
// 2、6、8、4 也是如此,这样可以保持图像是对称的,比较美观。
// 5 则单独使用一张图片。
//
// // 根据用户访问的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)
@ -32,6 +32,6 @@
// img := ii.Make([]byte("192.168.1.1"))
// img = ii.Make([]byte("192.168.1.2"))
//
// NOTE: go test 会在当前目录的testdata文件夹下产生大量的随机图片。
// NOTE: go test 会在当前目录的 testdata 文件夹下产生大量的随机图片。
// 要运行测试,必须保证该文件夹是存在的,且有相应的写入权限。
package identicon