Zero terminating, re-entrant. As log as the caller is careful not to share the
BASE64_STATE between threads it's threads safe.