public static long fromCode(String code) throws IllegalArgumentException {
        if (code == null || code.matches("/[^A-Za-z0-9\\-_]/"))
            throw new IllegalArgumentException("Input must be a valid Instagram shortcode.");
        String base2 = "";
        for (char c : code.toCharArray()) {
            int base64 = BASE64URL_CHARMAP.indexOf(c);
            base2 += String.format("%6s", Integer.toBinaryString(base64)).replace(' ', '0');
        }
        return Long.parseLong(base2, 2);
    }
Converts an Instagram shortcode to a numeric ID.

@param code The shortcode.
@return The numeric ID.
@throws IllegalArgumentException If bad parameters are provided.
src/main/java/com/github/instagram4j/instagram4j/utils/IGUtils.java