LaravelPackages.net
Acme Inc.
Toggle sidebar
ufucms/identicon-avatar

php生成identicon头像

15
0
0.0.1
About ufucms/identicon-avatar

ufucms/identicon-avatar is a Laravel package for php生成identicon头像. It currently has 0 GitHub stars and 15 downloads on Packagist (latest version 0.0.1). Install it with composer require ufucms/identicon-avatar. Discover more Laravel packages by ufucms or browse all Laravel packages to compare alternatives.

Last updated

identicon-avatar

Build Status 996.icu LICENSE

identicon 根据一个字符串(可以是用户的ID或者IP)的哈希值生成大量不重复的头像 很多大型IT网站上可以见到,比如 Github、Sourceforge、Stackoveflow。

安装

$ composer require ufucms/identicon-avatar:'dev-master'

使用

非laravel

<?php
require __DIR__.'/vendor/autoload.php';

use Valiner\IdenticonAvatar\Identicon;

$identicon = new Identicon();
//浏览器输出'sdp'的125px的图像
$identicon->getAvatar('sdp',125);

laravel

app('identicon')->getAvatar('sdp',125);

方法

浏览器输出'sdp'的125px的图像

$identicon->getAvatar('sdp',125)

保存'sdp'的125px的图像的图像到本地

$identicon->saveAvatar('sdp',125,__DIR_.'/test.png')

获取'sdp'的125px的图像的的BASE64

$identicon->getAvatarDataUri('sdp',125)

License

MIT

Comments