Update base64 dependency to the latest 0.21 version and while doing
that refactor some of the code where base64 is used. The refactoring
has a few benefits:
base64 encoding is now done into an on-stack buffer avoiding String
heap allocation,
Inserting Content-MD5 is now in a helper function avoiding code
duplication,
match is used rather than if-else-if chain so that self.command() is
now called only once and
there are now fewer ‘to_string’ calls reducing allocations.
Update base64 dependency to the latest 0.21 version and while doing that refactor some of the code where base64 is used. The refactoring has a few benefits: