This has already been implemented in the wild:
https://code.dlang.org/packages/base-d
Unlike std.base64, this library aims to do encoding and decoding in a lazy fashion. Of course, this means base-d will be slightly slower than the eager std.base64, but will operate without having to allocate any memory.
Comment #1 by robert.schadek — 2024-12-01T16:28:30Z