http://d.puremagic.com/issues/show_bug.cgi?id=9543

           Summary: Base64.decode shouldn't require source to have known
                    length
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: cbkbbej...@mailinator.com


--- Comment #0 from Nick Sabalausky <cbkbbej...@mailinator.com> 2013-02-19 
18:21:57 PST ---
A known source length, when it exists, should certainly still be used to:

A. Optimize the output buffer's allocation (when an output range or buffer
isn't already provided).

B. Verify sufficient output length in the case of a user-provided output array.

Both of which std.base64 already does.

However, a known source length shouldn't be *required*, because the algorithm
itself doesn't require it. When the source length doesn't exist, decode can
(and should) simply continue until source.empty is true.

Additionally, if the source length isn't known, and the user didn't provide an
output range/buffer, then std.array.Appender should be used instead of a
pre-allocated array.

I may put together a pull request for this if I get a chance.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to