Created
November 15, 2015 16:13
-
-
Save eur0pa/a0b4a5c39258ee0105e1 to your computer and use it in GitHub Desktop.
score.php
This file contains 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
// insert detailed score rundown from cdata details | |
// same for everybody | |
$details = array(); | |
$details_str = $score['details']; | |
// old versions still have 10 scores | |
// new patch goes up to 15 | |
// first versions have none, so we have to pre-populate | |
// the array or the insert statement will fail | |
for ($i = 0; $i < 16; $i++) { | |
$details[$i] = 0; | |
} | |
for ($i = 0; $i <= strlen($details_str) - 1; $i += 8) { | |
$hex = substr($details_str, $i, 8); | |
$dec = implode('', array_reverse(str_split($hex, 2))); | |
$details[($i/8)+1] = hexdec($dec); | |
} | |
$details[0] = $score['hash']; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment