def tr(x):
    """Translate a 6-bit value to the Base64 alphabet."""
    s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' \
      + 'abcdefghijklmnopqrstuvwxyz' \
      + '0123456789' \
      + '+/'
    return ord(s[x])