beesasoh
beesasoh

Reputation: 2125

PHP how to encode binary data to base 64

I am using PHP openssl_sign to create a digital signature using the tutorial here. How can i convert $signature (which contains binary data) to Base64.

Upvotes: 8

Views: 17644

Answers (2)

Matt Kent
Matt Kent

Reputation: 1185

Just do:

base64_encode($signature);

Read more here: http://php.net/manual/en/function.base64-encode.php

Upvotes: 7

Sjoerd
Sjoerd

Reputation: 75598

You can convert binary to base64 using base64_encode.

Upvotes: 9

Related Questions