Created
February 8, 2016 21:46
-
-
Save simplenotezy/c30ca5b0aea87ec0df57 to your computer and use it in GitHub Desktop.
Decode 64 hexadecimal characters APNS token to 32bit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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