Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static function base32_decode($s)
- {
- static $alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';
- $tmp = '';
- foreach (str_split($s) as $c) {
- if (false === ($v = strpos($alphabet, $c))) {
- $v = 0;
- }
- $tmp .= sprintf('%05b', $v);
- }
- $args = array_map('bindec', str_split($tmp, 8));
- array_unshift($args, 'C*');
- return rtrim(call_user_func_array('pack', $args), "\0");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement