I'm trying to implement in PHP something similar to Jeff Atwood's Equipping our ASCII armor. Here's C# Implementation of ASCII85.
Here's PHP Implementation of ASCII85
Here's how I convert the string to byte array:
$byteArr = str_split($uid);
foreach ($byteArr as $key=>$val) {
$byteArr[$key] = ord($val);
}
And what? now :) How to encode this byte array using ASCII 85 to get shorter UID?