inline JS::Result<mozilla::Ok> base64Decode4to3(std::string_view input, std::string &output) {
  uint8_t w, x, y, z;
  // 8.1 Find the code point pointed to by position in the second column of Table 1: The Base 64
  // Alphabet of RFC 4648. Let n be the number given in the first cell of the same row. [RFC4648]
  if (!base64CharacterToValue(input[0], &w) || !base64CharacterToValue(input[1], &x) ||
      !base64CharacterToValue(input[2], &y) || !base64CharacterToValue(input[3], &z)) {
    return JS::Result<mozilla::Ok>(JS::Error());
  }

  // 8.3 If buffer has accumulated 24 bits, interpret them as three 8-bit big-endian numbers. Append
  // three bytes with values equal to those numbers to output, in the same order, and then empty
  // buffer.
  output += (uint8_t(w << 2 | x >> 4));
  output += (uint8_t(x << 4 | y >> 2));
  output += (uint8_t(y << 6 | z));
  return mozilla::Ok();
}
inline JS::Result<mozilla::Ok> base64Decode4to3(std::string_view input, std::string &output) {
  uint8_t w, x, y, z;
   
   
  if (!base64CharacterToValue(input[0], &w) || !base64CharacterToValue(input[1], &x) ||
      !base64CharacterToValue(input[2], &y) || !base64CharacterToValue(input[3], &z)) {
    return JS::Result<mozilla::Ok>(JS::Error());
  }

   
   
   
  output += (uint8_t(w << 2 | x >> 4));
  output += (uint8_t(x << 4 | y >> 2));
  output += (uint8_t(y << 6 | z));
  return mozilla::Ok();
}