Created
February 4, 2019 21:23
-
-
Save vietj/8487068daddfb521c6b954a5aee84e65 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static int indexOf(byte c) { | |
| if (c == '-') { | |
| return 26; | |
| } else if (c >= '0' && c <= '9') { | |
| return c; | |
| } else if (c >= 'A' && c <= 'Z') { | |
| return c - 'A'; | |
| } else if (c >= 'a' && c <= 'z') { | |
| return c - 'a'; | |
| } else { | |
| throw new IllegalArgumentException("Invalid char: " + (char) c); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment