How do I convert to BASE 16 in PHP 5?

I have to pass a username to a webservice, and the API is asking for the following.

1: The username has to be encrypted with AES
2: The AES output has to be converted to BASE16
3: It is the BASE16 value I have to pass.

The encryption is easy - but 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.

EG:
$value = <AES Encrypted Username>;
$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?

[fphp]base_convert/fphp :slight_smile:

Thanks for the suggestion.

I have looked at base_convert, but I am not sure what I would be converting from.
What base number is an AES encypted string?

http://www.php.net/manual/en/function.bin2hex.php

Base 16 is hexadecimal.

I looked at bin2hex as well - but the AES encryption string is not binary so that is not producing the expected results.

Maybe sprintf(‘%x %X’, your_number);