Skip to content

Instantly share code, notes, and snippets.

@aegypius
aegypius / UUID.php
Created January 23, 2012 17:27 — forked from dahnielson/UUID.php
Pure PHP UUID generator
<?php
/**
* UUID class
*
* The following class generates VALID RFC 4211 COMPLIANT
* Universally Unique IDentifiers (UUID) version 3, 4 and 5.
*
* UUIDs generated validates using OSSP UUID Tool, and output
* for named-based UUIDs are exactly the same. This is a pure
* PHP implementation.
@aegypius
aegypius / base62.php
Created April 30, 2010 12:36 — forked from rduarte/base62.php
Base62 Encoding/Decoding
<?php
function base62_encode($num){
$chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$base = 62;
$result = '';
while($num >= $base) {
$r = $num%$base;
$result = $chars[$r].$result;
$num = $num/$base;