Reputation: 13
I have to pass username as an unique string to a webservice, and the API is asking for the following.
I cannot find a way to convert the value to BASE16.
PHP does not seem to have a BASE16_ENCODE
like it does for BASE64.
Example:
$value = <username as an unique string>;
$base16username = base16_encode('$value'); (< Since Base16_encode does not exist, this is my problem)
Google searches are leading me nowhere, nor is the PHP online manual so I suspect I might be overlooking something obvious. Any suggestions?
Upvotes: 1
Views: 3340
Reputation: 66500
Include the package in your composer.json
and use it like so:
$encoded = Base32::encode($string);
Upvotes: 3