Skip to content

Instantly share code, notes, and snippets.

@simplenotezy
Created February 8, 2016 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simplenotezy/c30ca5b0aea87ec0df57 to your computer and use it in GitHub Desktop.
Save simplenotezy/c30ca5b0aea87ec0df57 to your computer and use it in GitHub Desktop.
Decode 64 hexadecimal characters APNS token to 32bit
function base64_decode_apns_token($token) {
$a = unpack("H*hex", base64_decode($token));
$b = str_split($a["hex"], 8);
$output = "";
foreach ($b as $current) {
$output .= "$current";
}
return trim($output);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment