adding some base64 code to support R/P