After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 564728 - [Base64] Add function to decode base64 encoded data in place
[Base64] Add function to decode base64 encoded data in place
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
: 567436 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-12-16 12:44 UTC by Sebastian Dröge (slomo)
Modified: 2009-01-13 19:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
base64-inplace.diff (1.49 KB, patch)
2009-01-06 09:18 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2008-12-16 12:44:43 UTC
Hi
it'd be nice if glib provided a function for decoding base64 encoded data in place, i.e. without allocating new memory and with overwriting the input.

This always works because base64 encoded data is larger than the same data in decoded form.
Comment 1 Sebastian Dröge (slomo) 2009-01-06 09:18:16 UTC
Created attachment 125838 [details] [review]
base64-inplace.diff
Comment 2 Sebastian Dröge (slomo) 2009-01-10 10:39:03 UTC
Would be nice to get this into 2.20... or is it too late already?
Comment 3 Matthias Clasen 2009-01-13 04:13:54 UTC
I admit that I fail to see why this is adding new api, and not just an example for in-place decoding in the g_base64_decode_step() docs.
Comment 4 Sebastian Dröge (slomo) 2009-01-13 08:34:18 UTC
Well, it's a convenience function that cares for the string length and the (for this use case) irrelevant save and state variables.
Comment 5 Matthias Clasen 2009-01-13 19:31:33 UTC
*** Bug 567436 has been marked as a duplicate of this bug. ***
Comment 6 Matthias Clasen 2009-01-13 19:59:59 UTC
Ok, convinced.

2009-01-13  Matthias Clasen  <mclasen@redhat.com>

        Bug 564728 Add function to decode base64 encoded data in place

        * glib/glib.symbols:
        * glib/gbase64.[hc] (g_base64_decode_inplace): New convenience
        API to decode in place, overwriting the input string. Patch by
        Sebastian Dröge.