An ugly way to fix 48

This commit is contained in:
Dan 2018-04-09 23:43:07 +08:00 committed by GitHub
parent 6bd06644ae
commit de6120e5d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ class IntegerFormatter implements IFormatter
$digit = intval($arguments[1]);
}
$bn = Utils::toBn($value);
$bnHex = $bn->toHex($bn->is_negative);
$bnHex = $bn->toHex($value !== '48'); // An ugly way to fix 48 in ascii equal to zero
$padded = mb_substr($bnHex, 0, 1);
if ($padded !== 'f') {