Issue6557: Remove encodeBase64 and use btoa directly