cybersecurity · beginner · ~15 min

Valid base64 character?

Validate the base64 alphabet.

Challenge

Implement int is_base64_char(char c) returning 1 for A-Z, a-z, 0-9, '+', '/', and the padding '=', else 0.

Starter code

int is_base64_char(char c) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.