Documentation ¶
Overview ¶
Package base64dec contains a universal base64 decoder that works on both the standard and url-safe variants, padded and raw. The code is based on the standard encoding/base64 package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBase64 ¶
DecodeBase64 decodes src and writes at most base64.RawStdEncoding.DecodedLen(len(src)) bytes to dst and returns the number of bytes written. If src contains invalid base64 data, it will return the number of bytes successfully written and base64.CorruptInputError. New line characters (\r and \n) are ignored. The input can be in the standard or the alternate (aka url-safe) encoding. It can be padded or un-padded. If there is a correct padding, it is consumed and no error is returned. If there is no padding where it's required, no error is returned. If there is an incorrect padding (i.e. too many or too few characters) it is treated as garbage at the end (i.e. the error will point to the first padding character).