Windows 应用
Apache commons-codec-1.3.jar包
commons-codec-1.3.jar是JDK中一款用于编码运算的开源工具包,结构简单,调用方便,支持多种运算方式,有需要的程序猿们快来IT猫扑下载吧!commons-codec.jar介绍commons-codec是Apache开源组织提供的用于摘要运算、编码的包。commons-codec.jar内容Commonscodec,
- 当前版本
- 免费版
- 文件大小
- 50.00 KB
- 浏览次数
- 11
- 累计下载
- 0
软件介绍
功能说明、应用截图与使用信息

commons-codec-1.3.jar是jdk中一款用于编码运算的开源工具包,结构简单,调用方便,支持多种运算方式,有需要的程序猿们快来IT猫扑下载吧!
commons-codec.jar介绍
commons-codec是Apache开源组织提供的用于摘要运算、编码的包。
commons-codec.jar内容
Commons codec,是项目中用来处理常用的编码方法的工具类包,例如DES、SHA1、MD5、Base64,URL,Soundx等等。
不仅是编码,也可用于解码。
在该包中主要分为四类加密:BinaryEncoders、DigestEncoders、LanguageEncoders、NetworkEncoders。

commons-codec.jar运算示例
可逆算法
常规加密解密算法:BASE64
加密
String str= &abc&; // abc为要加密的字符串
byte[] b = Base64.encodeBase64(str.getBytes(), true);
System.out.println(new String(b));
解密
String str = &YWJj&; // YWJj为要解密的字符串
byte[] b = Base64.decodeBase64(str.getBytes());
System.out.println(new String(b));
不可逆算法
1、MD5
String str = &abc&;
DigestUtils.md5Hex(str);
附.net生成MD5的方法,生成内容跟java一致:
String str = &abc&;
FormsAuthentication.HashPasswordForStoringInConfigFile(str, &MD5&);
2、SHA1
String str = &abc&;
DigestUtils.shaHex(str);
附.net生成SHA1的方式,生成内容跟java一致:
String str = &abc&;
FormsAuthentication.HashPasswordForStoringInConfigFile(str, &SHA1&);
下载地址
下载前请确认版本和平台。外部下载由对应服务商提供,请勿忽略系统安全提示。









