BASE64_MAX
i = (psenc->cache << bits) & BASE64_MAX;
i = (psenc->cache >> bits) & BASE64_MAX;
pos = (psenc->cache << bits) & BASE64_MAX;