I am happy to take over the stdlib base64 API and make it stable if you guys agree with my proposals bellow:
This is the place where stdlib does not handle errors: [https://github.com/nim-lang/Nim/blob/master/lib/pure/base64.nim#L123](https://github.com/nim-lang/Nim/blob/master/lib/pure/base64.nim#L123) It needs to throw exception saying invalid base64 encoding instead of setting it to 63... RFC says to do so: [https://tools.ietf.org/html/rfc4648#section-3.3](https://tools.ietf.org/html/rfc4648#section-3.3) [https://github.com/nim-lang/Nim/blob/master/lib/pure/base64.nim#L47](https://github.com/nim-lang/Nim/blob/master/lib/pure/base64.nim#L47) The feature it should not support is lineLen and setting a custom newLine. It makes code slower. Python does not support this either: [https://docs.python.org/2/library/base64.html](https://docs.python.org/2/library/base64.html) I think I have seen this in ObjectiveC. I think this is only needed when used in emails? The RFC says: [https://tools.ietf.org/html/rfc4648#section-3.1](https://tools.ietf.org/html/rfc4648#section-3.1) to not support it? Leave it up to the email MIME spec. Multipurpose Internet Mail Extensions wrapper should do this part. See: [https://tools.ietf.org/html/rfc2045](https://tools.ietf.org/html/rfc2045) What makes my code faster is the lookup table and dropping support for MIME stuff which should not be there.
