Java tutorial
//package com.java2s; public class Main { private static final String BASE32_CHARS = "0123456789bcdefghjkmnpqrstuvwxyz"; public static int base32CharToValue(char base32Char) { int value = BASE32_CHARS.indexOf(base32Char); if (value == -1) { throw new IllegalArgumentException("Not a valid base32 char: " + base32Char); } else { return value; } } }