package com.youngsun.lbt;
publicclass ShortUrlGenerator {
publicstaticvoid main(String[] args) {
// 长连接: http://www.young-sun.com
// 新浪解析后的短链接为: http://***/Nvqqem
String sLongUrl = "http://www.young-sun.com" ; // 3BD768E58042156E54626860E241E999
String[] aResult = shortUrl (sLongUrl);
// 打印出结果
for ( int i = 0; i < aResult. length ; i++) {
System. out .println( "The string [" + i + "] is " + aResult[i]);
}
}
publicstatic String[] shortUrl(String url) {
// 可以自定义生成 MD5 加密字符传前的混合 KEY
String key = "libotao" ;
// 要使用生成 URL 的字符
String[] chars = new String[] { "a" , "b" , "c" , "d" , "e" , "f" , "g" , "h" ,
"i" , "j