programming languages - Invalid base64 in Facebook signed_request documentation example -


the documentation @ https://developers.facebook.com/docs/authentication/signed_request/ provides example of encoded data, seems wrong.

<?php     echo base64_decode("eyjhbgdvcml0ag0ioijitufdlvniqti1niisijaioijwyxlsb2fkin0");     echo "\n";     echo base64_encode('{"algorithm":"hmac-sha256","0":"payload"}');     echo "\n"; ?> 

gives output:

{"algorithm":"hmac-sha256","0":"payload"} eyjhbgdvcml0ag0ioijitufdlvniqti1niisijaioijwyxlsb2fkin0= 

the argument base64_decode missing = padding character. using base64_encode on same data shows not created php, or php version used bugged, or don't know what. same documentation page provides signature signs missing = string.

question: omission of padding bug in facebook documentation, or should expect these kinds of omissions in production code?

other languages don't fail "gracefully" php does, , not decode base64 data missing padding signs - important.

my shop stuff in c#, , went adding padding ourselves.

knowing facebook, years of developing on platform ... well, let's little documentation hiccup doesn't surprise me @ all.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -