I'm trying to use a service which "base64 converts" their data which they then push to my server. The data is divided into three data types: strings, integers and booleans. Why they package it this way I don't understand, but it's up to me to decipher it.
I have a string Qjo0MDk2
which should convert to B:4096
and PHP's native base64_decode
function works!
However, if I try to convert AAATmg==
to a base-10 (decimal) integer value, I want to get 5018
, but base64_decode
just gives me nothing. (I assume because it's trying to convert to a string, rather than a base-10 integer.)
Likewise, AA==
should convert to 0
in base-2 (binary) boolean values, while AQ==
should convert to 1
in the same.
Is there a set of functions that does this already somewhere? I can't imagine this is new. Here is a website that does it today, but the code is not exposed: https://conv.darkbyte.ru/