import string.md5;
import string.sha1;
import string.crc32;
import string.xxtea;

//打开控制台
io.open();
io.print("请输入一行文本，然后回车")

var str = io.stdin.read(); 

md32,md16 = string.md5(str,true) ;
io.print("md5加密结果" ,md32,md16  );

sha = string.sha1(str);
io.print("sha1加密结果" ,sha  );

crc = string.crc32(str ) ;
io.print("crc32加密结果" , string.format("%x", crc:"" )  );

xx = string.xxtea.encrypt(str,"abcdfasdf" ) ;
io.print("xxtea加密结果" ,xx  );
 
xx = string.xxtea.decrypt(xx,"abcdfasdf" ) ;
io.print("xxtea解密结果" ,xx  );

execute("pause") //按任意键继续
io.close();
