Skip to content

Instantly share code, notes, and snippets.

@salathe

salathe/Y64.php Secret

Created May 4, 2011 14:27
Show Gist options
  • Save salathe/177ff89f541d6184a7b6 to your computer and use it in GitHub Desktop.
Save salathe/177ff89f541d6184a7b6 to your computer and use it in GitHub Desktop.
Y64 - URL-safe Base64
<?php
function Y64_encode($input) {
return strtr(base64_encode($input), '+/=', '._-');
}
function Y64_decode($input) {
return base64_decode(strtr($input, '._-', '+/='));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment