This file contains 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
package nice.shorturl.utils; | |
import com.google.common.base.Charsets; | |
import com.google.common.hash.Hashing; | |
public class ShortUrlGenerator { | |
private static final String ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | |
private static final int BASE = ALPHABET.length(); | |
public static String encode(int num) { |
OlderNewer