PHP Class PrivateBin\Vizhash16x16

Example: $vz = new Vizhash16x16(); $data = $vz->generate(sha512('hello')); header('Content-type: image/png'); echo $data; exit;
Mostra file Open project: privatebin/privatebin Class Usage Examples

Public Methods

Method Description
__construct ( ) : void constructor
generate ( string $text ) : string Generate a 16x16 png corresponding to $text.

Private Methods

Method Description
degrade ( resource $img, string $direction, array $color1, array $color2 ) : resource Gradient function
drawshape ( resource $image, integer $action, integer $color ) : void Draw a shape
getInt ( ) : integer Returns a single integer from the $VALUES array (0.
getX ( ) : integer Returns a single integer from the array (roughly mapped to image width)
getY ( ) : integer Returns a single integer from the array (roughly mapped to image height)

Method Details

__construct() public method

constructor
public __construct ( ) : void
return void

generate() public method

The given text should to be 128 to 150 characters long
public generate ( string $text ) : string
$text string
return string PNG data. Or empty string if GD is not available.