base64 encoding using the new binary syntax

Sean Hinde <>
Mon Sep 25 21:37:37 CEST 2000


Some more observations:

If in the shell you do:

74> A=lists:duplicate(40000,3).                         
[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3|...]
75> B=list_to_binary(A).                                
<<3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3|... 40000
bytes>>
76> <<B/binary,B/binary>>.
<<3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3|... 80000
bytes>>
77> A++A.
[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3|...]

<<B/binary,B/binary>> visibly takes ages but A++A. returns immediately!

Also:

79> io:format("~p",[<<B/binary>>]). 
<<3>>ok

OR

80> io:format("~p",[B]).  
<<3>>ok

doesn't look very correct.

Sean



NOTICE AND DISCLAIMER:
This email (including attachments) is confidential.  If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents.  We cannot accept liability for any breaches of
confidence arising through use of email.  Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions.  We will not accept responsibility for any commitments
made by our employees outside the scope of our business.  We do not warrant
the accuracy or completeness of such information.





More information about the erlang-questions mailing list