add encode and decode functions for base64 encoding