You are right!<div>Thank you!<br clear="all"><div>Best regards,</div><div>Max</div><br><br>
<br><br><div class="gmail_quote">On Wed, Dec 21, 2011 at 6:54 PM, Heinz N. Gies <span dir="ltr"><<a href="mailto:heinz@licenser.net">heinz@licenser.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word">As an addition look closely at the decoding on the webside, it also fails the last two characters are missing unless you add the missing '=' to the base64 encoded data.<div><br></div>

<div>Regards,</div><div>Heinz<div class="im"><br><div>
<span style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">--<br>

Heinz N. Gies<br><a href="mailto:heinz@licenser.net" target="_blank">heinz@licenser.net</a><br><a href="http://licenser.net" target="_blank">http://licenser.net</a></span>
</div>
<br></div><div><div class="im"><div>On Dec 21, 2011, at 16:44, Max Bourinov wrote:</div><br></div><blockquote type="cite"><div><div class="h5">Hi guys,<div><br></div><div>Does anybody knows why base64:decode fails on strings like this:</div>

<div><br></div><div>eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImNyZWRpdHMiOnsib3JkZXJfZGV0YWlscyI6IntcIm9yZGVyX2lkXCI6Mjg1NTAwMDgxNTAxMTU4LFwiYnV5ZXJcIjoxMDI3NDE5NzkzLFwiYXBwXCI6MTY4MzExOTc2NTgwNDUwLFwicmVjZWl2ZXJcIjoxMDI3NDE5NzkzLFwiYW1vdW50XCI6MSxcInVwZGF0ZV90aW1lXCI6MTMyNDQ3OTA3NixcInRpbWVfcGxhY2VkXCI6MTMyNDQ3OTA3NCxcImRhdGFcIjpcIlwiLFwiaXRlbXNcIjpbe1wiaXRlbV9pZFwiOlwiMFwiLFwidGl0bGVcIjpcIkEgRmFjZWJvb2sgSGF0XCIsXCJkZXNjcmlwdGlvblwiOlwiVGhlIGNvb2xlc3QgaGF0IHlvdSd2ZSBldmVyIHNlZW4uXCIsXCJpbWFnZV91cmxcIjpcImh0dHA6XFxcL1xcXC93d3cuZmFjZWJvb2suY29tXFxcL2ltYWdlc1xcXC9naWZ0c1xcXC83NDAucG5nXCIsXCJwcm9kdWN0X3VybFwiOlwiaHR0cDpcXFwvXFxcL3d3dy5mYWNlYm9vay5jb21cXFwvaW1hZ2VzXFxcL2dpZnRzXFxcLzc0MC5wbmdcIixcInByaWNlXCI6MSxcImRhdGFcIjpcIlwifV0sXCJzdGF0dXNcIjpcInBsYWNlZFwifSIsInN0YXR1cyI6InBsYWNlZCIsIm9yZGVyX2lkIjoyODU1MDAwODE1MDExNTgsInRlc3RfbW9kZSI6MX0sImV4cGlyZXMiOjEzMjQ0ODMyMDAsImlzc3VlZF9hdCI6MTMyNDQ3OTA3Niwib2F1dGhfdG9rZW4iOiJBQUFDWkFGQ1pCVFZXSUJBQzBhYkhWb3dLRWdTVHVOQ3ZDYjRTR21hWkE4STdYc3Z0bXBZZU1hTWx3clNia0U5dkxKTHRldUdraWpNakh4aVpBVWY5am9RcG9aQ3ZWYW9YVUN6N21zU3Bjb0FuWGhKRDVRU0lRIiwidXNlciI6eyJjb3VudHJ5IjoicnUiLCJsb2NhbGUiOiJlbl9VUyIsImFnZSI6eyJtaW4iOjIxfX0sInVzZXJfaWQiOiIxMDI3NDE5NzkzIn0</div>



<div><br></div><div>You can easily decode it with online tool like this: <a href="http://www.motobit.com/util/base64-decoder-encoder.asp" target="_blank">http://www.motobit.com/util/base64-decoder-encoder.asp</a></div><div>

<br></div><div>

But lovely Erlang says:</div><div><br></div><div><div>** exception error: no function clause matching base64:decode("Jye",</div><div>                                                              [133,177,157,189,201,165,209,161,180,136,232,137,33,53,5,12,</div>



<div>                                                               181,77,33,4,200,212,216,136,176,137,141|...])</div><div>     in function  base64:decode/1</div></div><div><br></div><div>Seems something wrong with pattern matching or what could it be? And most interesting question - how to find a proper work around?</div>



<div><br></div><div><br clear="all"><div>Best regards,</div><div>Max</div><br><br>
</div></div></div><div class="im">
_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>

</div></blockquote></div><br></div></div><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>