- 浏览: 413747 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (184)
- IDE (4)
- dotCMS (3)
- Liferay Portal (1)
- J2EE (7)
- My SQL (16)
- IBM DB2 (3)
- Oracle (2)
- JDBC (4)
- Hibernate (3)
- JSP (0)
- Framework (4)
- Java编程 (30)
- C++编程 (0)
- Struts 1.X (2)
- Struts 2.X (6)
- Linux (11)
- Spring (7)
- JavaScript (6)
- Ajax (2)
- XML (3)
- IBM Websphere Portal (1)
- IBM Lotus Quickr (1)
- CMS (2)
- ERP (0)
- CRM (0)
- 大型网站架构开发 (1)
- 面试武器 (2)
- HTML 5 (2)
- dTree && webFxloadTree (2)
- JVM (7)
- SQL Server (3)
- Tomcat && Apache && Jboss && Weblogic-中间件 (4)
- FreeMarker (2)
- MongoDB (7)
- OpenSource开源 (24)
- Cloud (0)
- FFmpeg (3)
- Thrift (1)
- SpringSide (1)
- Design Pattern (1)
- solr&&ES (2)
- git&svn (1)
- 大数据 (8)
- 人工智能 (0)
- Hadoop (3)
- Spark (0)
- Sqoop (1)
- Flume (1)
- Hive (3)
- HDFS (4)
- ES (0)
- Redis (1)
- Kafka (3)
- MR (0)
- 机器学习 (0)
- 深度学习 (0)
- Impala (2)
- HBase (2)
- Spring Boot (1)
- Spring Cloud (0)
- 大数据架构 (6)
- 架构思想理论 (6)
- 技术管理 (4)
- 数据结构与算法 (4)
最新评论
-
huijz:
...
Spring Data JPA研究-使用Spring Data JPA 简化JPA 开发(ZZ) -
用户名不存在:
[img][/img][*]引用[u][/u][i][/i][ ...
MongoDB 模糊查询的三种实现方式-morphia实现 -
junsheng100:
请给个完整的例子吧!包括jar文件等
java调用ffmpeg获取视频文件信息参数代码 -
mj:
谢谢!!
SQL Server里面如何导出包含(insert into)数据的SQL脚本 (转载ZZ)
MD5加密的几种实现方式如下:
一、第一种方式
DigestUtils.md5Hex(member.getPassword())
需要引入commons-codec-1.4.jar
二、第二种方式
String tmpPassword = MD5Creator.getDM5Password(member.getUsername(), member.getPassword());
1)新建MD5Creator类
import org.acegisecurity.providers.encoding.Md5PasswordEncoder;
import org.apache.commons.codec.digest.DigestUtils;
public class MD5Creator extends DigestUtils
{
private static Md5PasswordEncoder a = new Md5PasswordEncoder();
public static String getDM5Password(String paramString)
{
return a.encodePassword(paramString, null);
}
public static String getDM5Password(String paramString1, String paramString2)
{
return a.encodePassword(paramString2, paramString1);
}
public static void main(String[] paramArrayOfString)
{
}
}
需要引入commons-codec-1.4.jar和acegi-security-1.0.6.jar这两个jar enough。
三、第三种方式
String md5Str = getMd5("test");
方法:
public static String getMd5(String plainText) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(plainText.getBytes());
byte b[] = md.digest();
int i;
StringBuffer buf = new StringBuffer("");
for (int offset = 0; offset < b.length; offset++) {
i = b[offset];
if (i < 0)
i += 256;
if (i < 16)
buf.append("0");
buf.append(Integer.toHexString(i));
}
//32位加密
return buf.toString();
// 16位的加密
// return buf.toString().substring(8, 24);
} catch (NoSuchAlgorithmException e) {
return null;
}
}
四、第四种方式
String str =new MD5().getMD5(content);
需要引入commons-lang-2.5.jar
import org.apache.commons.lang.StringUtils;
public class MD5 {
int buf[]; // These were originally unsigned ints.
// This Java code makes an effort to avoid sign traps.
// buf[] is where the hash accumulates.
long bits; // This is the count of bits hashed so far.
byte in[]; // This is a buffer where we stash bytes until we have
// enough (64) to perform a transform operation.
int inint[];
// inint[] used and discarded inside transform(),
// but why allocate it over and over?
// (In the C version this is allocated on the stack.)
public MD5() {
buf = new int[4];
// fill the hash accumulator with a seed value
buf[0] = 0x67452301;
buf[1] = 0xefcdab89;
buf[2] = 0x98badcfe;
buf[3] = 0x10325476;
// initially, we've hashed zero bits
bits = 0L;
in = new byte[64];
inint = new int[16];
}
public void update(byte[] newbuf) {
update(newbuf, 0, newbuf.length);
}
public void update(byte[] newbuf, int length) {
update(newbuf, 0, length);
}
public void update(byte[] newbuf, int bufstart, int buflen) {
int t;
int len = buflen;
// shash old bits value for the "Bytes already in" computation
// just below.
t = (int) bits; // (int) cast should just drop high bits, I hope
/* update bitcount */
/* the C code used two 32-bit ints separately, and carefully
* ensured that the carry carried.
* Java has a 64-bit long, which is just what the code really wants.
*/
bits += (len << 3);
t = (t >>> 3) & 0x3f; /* Bytes already in this->in */
/* Handle any leading odd-sized chunks */
/* (that is, any left-over chunk left by last update() */
if (t != 0) {
int p = t;
t = 64 - t;
if (len < t) {
System.arraycopy(newbuf, bufstart, in, p, len);
return;
}
System.arraycopy(newbuf, bufstart, in, p, t);
transform();
bufstart += t;
len -= t;
}
/* Process data in 64-byte chunks */
while (len >= 64) {
System.arraycopy(newbuf, bufstart, in, 0, 64);
transform();
bufstart += 64;
len -= 64;
}
/* Handle any remaining bytes of data. */
/* that is, stash them for the next update(). */
System.arraycopy(newbuf, bufstart, in, 0, len);
}
/*
* Final wrapup - pad to 64-byte boundary with the bit pattern
* 1 0* (64-bit count of bits processed, MSB-first)
*/
public void md5final(byte[] digest) {
/* "final" is a poor method name in Java. :v) */
int count;
int p; // in original code, this is a pointer; in this java code
// it's an index into the array this->in.
/* Compute number of bytes mod 64 */
count = (int) ((bits >>> 3) & 0x3F);
/* Set the first char of padding to 0x80. This is safe since there is
always at least one byte free */
p = count;
in[p++] = (byte) 0x80;
/* Bytes of padding needed to make 64 bytes */
count = 64 - 1 - count;
/* Pad out to 56 mod 64 */
if (count < 8) {
/* Two lots of padding: Pad the first block to 64 bytes */
zeroByteArray(in, p, count);
transform();
/* Now fill the next block with 56 bytes */
zeroByteArray(in, 0, 56);
} else {
/* Pad block to 56 bytes */
zeroByteArray(in, p, count - 8);
}
/* Append length in bits and transform */
// Could use a PUT_64BIT... func here. This is a fairly
// direct translation from the C code, where bits was an array
// of two 32-bit ints.
int lowbits = (int) bits;
int highbits = (int) (bits >>> 32);
PUT_32BIT_LSB_FIRST(in, 56, lowbits);
PUT_32BIT_LSB_FIRST(in, 60, highbits);
transform();
PUT_32BIT_LSB_FIRST(digest, 0, buf[0]);
PUT_32BIT_LSB_FIRST(digest, 4, buf[1]);
PUT_32BIT_LSB_FIRST(digest, 8, buf[2]);
PUT_32BIT_LSB_FIRST(digest, 12, buf[3]);
/* zero sensitive data */
/* notice this misses any sneaking out on the stack. The C
* version uses registers in some spots, perhaps because
* they care about this.
*/
zeroByteArray(in);
zeroIntArray(buf);
bits = 0;
zeroIntArray(inint);
}
public static void main(String args[]) {
System.out.println(getMD5("1"));
System.out.println(getMD5("1"));
byte[] b = HexString2Bytes("c4ca4238a0b923820dcc509a6f75849b");
for (byte b1 : b) {
System.out.print(b1 + " ");
}
System.out.println(GFString.byte2hex(b));
}
public static byte[] HexString2Bytes(String src) {
byte[] ret = new byte[16];
byte[] tmp = src.getBytes();
for (int i = 0; i < 16; i++) {
ret[i] = uniteBytes(tmp[i * 2], tmp[i * 2 + 1]);
}
return ret;
}
public static byte uniteBytes(byte src0, byte src1) {
byte _b0 = Byte.decode("0x" + new String(new byte[] { src0 })).byteValue();
_b0 = (byte) (_b0 << 4);
byte _b1 = Byte.decode("0x" + new String(new byte[] { src1 })).byteValue();
byte ret = (byte) (_b0 ^ _b1);
return ret;
}
public static String getMD5(String content) {
if (StringUtils.isNotBlank(content)) {
MD5 md = new MD5();
md.update(content.getBytes(), content.length());
byte out[] = new byte[16];
md.md5final(out);
return dumpBytes(out);
}
return StringUtils.EMPTY;
}
/////////////////////////////////////////////////////////////////////
// Below here ye will only finde private functions //
/////////////////////////////////////////////////////////////////////
// There must be a way to do these functions that's
// built into Java, and I just haven't noticed it yet.
private void zeroByteArray(byte[] a) {
zeroByteArray(a, 0, a.length);
}
private void zeroByteArray(byte[] a, int start, int length) {
setByteArray(a, (byte) 0, start, length);
}
private void setByteArray(byte[] a, byte val, int start, int length) {
int i;
int end = start + length;
for (i = start; i < end; i++) {
a[i] = val;
}
}
private void zeroIntArray(int[] a) {
zeroIntArray(a, 0, a.length);
}
private void zeroIntArray(int[] a, int start, int length) {
setIntArray(a, 0, start, length);
}
private void setIntArray(int[] a, int val, int start, int length) {
int i;
int end = start + length;
for (i = start; i < end; i++) {
a[i] = val;
}
}
// In the C version, a call to MD5STEP is a macro-in-a-macro.
// In this Java version, we pass an Fcore object to represent the
// inner macro, and the MD5STEP() method performs the work of
// the outer macro. It would be good if this could all get
// inlined, but it would take a pretty aggressive compiler to
// inline away the dynamic method lookup made by MD5STEP to
// get to the Fcore.f function.
private abstract class Fcore {
abstract int f(int x, int y, int z);
}
private final Fcore F1 = new Fcore() {
@Override
int f(int x, int y, int z) {
return (z ^ (x & (y ^ z)));
}
};
private final Fcore F2 = new Fcore() {
@Override
int f(int x, int y, int z) {
return (y ^ (z & (x ^ y)));
}
};
private final Fcore F3 = new Fcore() {
@Override
int f(int x, int y, int z) {
return (x ^ y ^ z);
}
};
private final Fcore F4 = new Fcore() {
@Override
int f(int x, int y, int z) {
return (y ^ (x | ~z));
}
};
private int MD5STEP(Fcore f, int w, int x, int y, int z, int data, int s) {
w += f.f(x, y, z) + data;
w = w << s | w >>> (32 - s);
w += x;
return w;
}
private void transform() {
/* load in[] byte array into an internal int array */
int i;
int[] inint = new int[16];
for (i = 0; i < 16; i++) {
inint[i] = GET_32BIT_LSB_FIRST(in, 4 * i);
}
int a, b, c, d;
a = buf[0];
b = buf[1];
c = buf[2];
d = buf[3];
a = MD5STEP(F1, a, b, c, d, inint[0] + 0xd76aa478, 7);
d = MD5STEP(F1, d, a, b, c, inint[1] + 0xe8c7b756, 12);
c = MD5STEP(F1, c, d, a, b, inint[2] + 0x242070db, 17);
b = MD5STEP(F1, b, c, d, a, inint[3] + 0xc1bdceee, 22);
a = MD5STEP(F1, a, b, c, d, inint[4] + 0xf57c0faf, 7);
d = MD5STEP(F1, d, a, b, c, inint[5] + 0x4787c62a, 12);
c = MD5STEP(F1, c, d, a, b, inint[6] + 0xa8304613, 17);
b = MD5STEP(F1, b, c, d, a, inint[7] + 0xfd469501, 22);
a = MD5STEP(F1, a, b, c, d, inint[8] + 0x698098d8, 7);
d = MD5STEP(F1, d, a, b, c, inint[9] + 0x8b44f7af, 12);
c = MD5STEP(F1, c, d, a, b, inint[10] + 0xffff5bb1, 17);
b = MD5STEP(F1, b, c, d, a, inint[11] + 0x895cd7be, 22);
a = MD5STEP(F1, a, b, c, d, inint[12] + 0x6b901122, 7);
d = MD5STEP(F1, d, a, b, c, inint[13] + 0xfd987193, 12);
c = MD5STEP(F1, c, d, a, b, inint[14] + 0xa679438e, 17);
b = MD5STEP(F1, b, c, d, a, inint[15] + 0x49b40821, 22);
a = MD5STEP(F2, a, b, c, d, inint[1] + 0xf61e2562, 5);
d = MD5STEP(F2, d, a, b, c, inint[6] + 0xc040b340, 9);
c = MD5STEP(F2, c, d, a, b, inint[11] + 0x265e5a51, 14);
b = MD5STEP(F2, b, c, d, a, inint[0] + 0xe9b6c7aa, 20);
a = MD5STEP(F2, a, b, c, d, inint[5] + 0xd62f105d, 5);
d = MD5STEP(F2, d, a, b, c, inint[10] + 0x02441453, 9);
c = MD5STEP(F2, c, d, a, b, inint[15] + 0xd8a1e681, 14);
b = MD5STEP(F2, b, c, d, a, inint[4] + 0xe7d3fbc8, 20);
a = MD5STEP(F2, a, b, c, d, inint[9] + 0x21e1cde6, 5);
d = MD5STEP(F2, d, a, b, c, inint[14] + 0xc33707d6, 9);
c = MD5STEP(F2, c, d, a, b, inint[3] + 0xf4d50d87, 14);
b = MD5STEP(F2, b, c, d, a, inint[8] + 0x455a14ed, 20);
a = MD5STEP(F2, a, b, c, d, inint[13] + 0xa9e3e905, 5);
d = MD5STEP(F2, d, a, b, c, inint[2] + 0xfcefa3f8, 9);
c = MD5STEP(F2, c, d, a, b, inint[7] + 0x676f02d9, 14);
b = MD5STEP(F2, b, c, d, a, inint[12] + 0x8d2a4c8a, 20);
a = MD5STEP(F3, a, b, c, d, inint[5] + 0xfffa3942, 4);
d = MD5STEP(F3, d, a, b, c, inint[8] + 0x8771f681, 11);
c = MD5STEP(F3, c, d, a, b, inint[11] + 0x6d9d6122, 16);
b = MD5STEP(F3, b, c, d, a, inint[14] + 0xfde5380c, 23);
a = MD5STEP(F3, a, b, c, d, inint[1] + 0xa4beea44, 4);
d = MD5STEP(F3, d, a, b, c, inint[4] + 0x4bdecfa9, 11);
c = MD5STEP(F3, c, d, a, b, inint[7] + 0xf6bb4b60, 16);
b = MD5STEP(F3, b, c, d, a, inint[10] + 0xbebfbc70, 23);
a = MD5STEP(F3, a, b, c, d, inint[13] + 0x289b7ec6, 4);
d = MD5STEP(F3, d, a, b, c, inint[0] + 0xeaa127fa, 11);
c = MD5STEP(F3, c, d, a, b, inint[3] + 0xd4ef3085, 16);
b = MD5STEP(F3, b, c, d, a, inint[6] + 0x04881d05, 23);
a = MD5STEP(F3, a, b, c, d, inint[9] + 0xd9d4d039, 4);
d = MD5STEP(F3, d, a, b, c, inint[12] + 0xe6db99e5, 11);
c = MD5STEP(F3, c, d, a, b, inint[15] + 0x1fa27cf8, 16);
b = MD5STEP(F3, b, c, d, a, inint[2] + 0xc4ac5665, 23);
a = MD5STEP(F4, a, b, c, d, inint[0] + 0xf4292244, 6);
d = MD5STEP(F4, d, a, b, c, inint[7] + 0x432aff97, 10);
c = MD5STEP(F4, c, d, a, b, inint[14] + 0xab9423a7, 15);
b = MD5STEP(F4, b, c, d, a, inint[5] + 0xfc93a039, 21);
a = MD5STEP(F4, a, b, c, d, inint[12] + 0x655b59c3, 6);
d = MD5STEP(F4, d, a, b, c, inint[3] + 0x8f0ccc92, 10);
c = MD5STEP(F4, c, d, a, b, inint[10] + 0xffeff47d, 15);
b = MD5STEP(F4, b, c, d, a, inint[1] + 0x85845dd1, 21);
a = MD5STEP(F4, a, b, c, d, inint[8] + 0x6fa87e4f, 6);
d = MD5STEP(F4, d, a, b, c, inint[15] + 0xfe2ce6e0, 10);
c = MD5STEP(F4, c, d, a, b, inint[6] + 0xa3014314, 15);
b = MD5STEP(F4, b, c, d, a, inint[13] + 0x4e0811a1, 21);
a = MD5STEP(F4, a, b, c, d, inint[4] + 0xf7537e82, 6);
d = MD5STEP(F4, d, a, b, c, inint[11] + 0xbd3af235, 10);
c = MD5STEP(F4, c, d, a, b, inint[2] + 0x2ad7d2bb, 15);
b = MD5STEP(F4, b, c, d, a, inint[9] + 0xeb86d391, 21);
buf[0] += a;
buf[1] += b;
buf[2] += c;
buf[3] += d;
}
private int GET_32BIT_LSB_FIRST(byte[] b, int off) {
return ((b[off + 0] & 0xff)) | ((b[off + 1] & 0xff) << 8) | ((b[off + 2] & 0xff) << 16)
| ((b[off + 3] & 0xff) << 24);
}
private void PUT_32BIT_LSB_FIRST(byte[] b, int off, int value) {
b[off + 0] = (byte) (value & 0xff);
b[off + 1] = (byte) ((value >> 8) & 0xff);
b[off + 2] = (byte) ((value >> 16) & 0xff);
b[off + 3] = (byte) ((value >> 24) & 0xff);
}
// These are debug routines I was using while trying to
// get this code to generate the same hashes as the C version.
// (IIRC, all the errors were due to the absence of unsigned
// ints in Java.)
/*
private void debugStatus(String m) {
System.out.println(m+":");
System.out.println("in: "+dumpBytes(in));
System.out.println("bits: "+bits);
System.out.println("buf: "
+Integer.toHexString(buf[0])+" "
+Integer.toHexString(buf[1])+" "
+Integer.toHexString(buf[2])+" "
+Integer.toHexString(buf[3]));
}
*/
private static String dumpBytes(byte[] bytes) {
int i;
StringBuffer sb = new StringBuffer();
for (i = 0; i < bytes.length; i++) {
if (i % 32 == 0 && i != 0) {
sb.append("\n");
}
String s = Integer.toHexString(bytes[i]);
if (s.length() < 2) {
s = "0" + s;
}
if (s.length() > 2) {
s = s.substring(s.length() - 2);
}
sb.append(s);
}
return sb.toString();
}
}
发表评论
-
Java应用OOM内存过高解决及优化
2022-04-27 17:49 894JVM OOM优化 jmap -heap 303 ... -
哈希算法与MurmurHash3
2022-04-12 15:25 1340MurmurHash 哈希算法 ... -
SQL注入攻击防范研究
2021-12-27 15:25 188SQL注入攻击如何攻击的: JDBC Statemen ... -
IDEA快捷键
2021-12-23 15:53 316IDEA快捷键 1.创建main函数快捷键 在编写代码 ... -
JAVA 8的Lambda表达式和Stream API研究
2018-03-21 17:31 740JAVA 8 Lambda表达式简化了代码开发,代码简洁, ... -
ThreadPoolExecutor里面4种拒绝策略(转)
2017-12-14 18:03 3128ThreadPoolExecutor类实现了Executo ... -
MySQL函数研究总结-CONCAT、REPLACE、ROUND、FLOOR和CEILING、TRUNCATE、CASE WHEN等
2017-02-20 16:26 1509CONCAT、REPLACE、ROUND、FLOOR和CEI ... -
itext实现PDF生成的两种方式-从HTML到PDF
2017-01-18 14:38 10900itext实现PDF生成的两种方式-从HTML到PDF ... -
Java处理Http请求的几种方式总结
2017-01-10 18:17 94351.commons-httpclient 简洁快速模拟H ... -
javaMelody监控接入使用
2016-03-03 23:55 13471.jar pom <!-- javamelody ... -
多线程-java线程池使用
2016-03-01 16:46 1184(一) new Thread(new SolrDataH ... -
java.io.IOException: Too many open files解决方案
2013-03-06 15:35 11689异常:java.io.IOException: Too m ... -
Guava(石榴)使用研究-Google开源Collection类库
2013-01-29 18:33 13481)Guava 简介 Guava 中文是石榴的意思,该项 ... -
Joda-Time&Date4j使用研究-开源JAVA日期时间处理类库
2013-01-29 18:27 21341)Joda-Time简介 Joda-Time提供了一组 ... -
Maven常用配置及Tomcat插件配置
2013-01-25 12:54 17210Maven用了一段时间了,基本上被我摆平了。结合Eclip ... -
GitHub无法访问,修改hosts文件解决
2013-01-22 15:30 1137前几天由于12306的抢票 ... -
JAVA 定时方式大总结
2012-05-17 19:38 1433JAVA 定时方式大总结 除了Quartz之外,JAV ... -
获取spring容器applicationContext的几种方式
2012-04-13 10:39 2225一、定义web.xml,由web容器自动加载配置文件初始 ... -
J2EE快速开发框架wabacus3.2简介
2012-03-16 18:45 2103J2EE快速开发框架wabacus 3.2 发布,提高J ... -
第三只眼看SpringSide-一个极富魅力的偶像团队(ZZ)
2012-03-15 14:06 1703第三只眼看SpringSide-一个极富魅力的偶像团队 ...
相关推荐
Excel的字段MD5加密,一种是VBA函数,另一种为宏函数。建议使用VBA函数。会相对简单。具体的函数使用组合键Alt+F11即可查看,
尽管MD4算法在安全上有个这么大漏洞但它对在其后才被开发出来好几种信息安全加密算法出现却有着不 可忽视引导作用除了MD5以外其中比较有名还有SHA-1、RIPE-MD以及HAVAL等 年以后即1991年Rivest开发出技术上更为...
这是我个人收集的几种MD5加密方式,分享一下
.Net c# 几种加密方法固定key 随机key 对称加密 MD5等
有几种常见的加密方式和实现.
上次曾经传过一个易宝、支付宝、财付通、云网等多用MD5加密程序。 易宝是采用hmac的MD5加密,提供的ASP版函数不支持中文,使用dll注册那个兼容又不太好。 上次我发布的加密程序也不支持中文,且支付宝那个加密函数是...
C#加密解密源码 有不可逆加密和可逆加密,可逆加密,MD5不可逆加密等几种方法
明文加密的几种方法,包括MD5加密算法,SHA-256加密算法,Base64加密算法
常见的几种加密方法和实现, SHA1、RSA、AES、 DES、MD5的具体实现
ASP.NET加密教程(MD5和SHA1加密几种方法) 很简单的一个文本文件,不要分简单的说明
加密算法:我这有几种加解密算法,暂时拿来一起用用!
C#的MD5加密的几种方法,想学习加密技术的同学不要错过。
这是C#的几种加密和解密的方法,里面包含Base64的加密和解密,MD5的加密,SHA1的加密和解密,文件夹的加密和解密
这是C#的几种加密和解密的方法,里面包含Base64的加密和解密,MD5的加密,SHA1的加密和解密,文件夹的加密和解密
web前端三种常见的通过JS加密文本方式,包含md5、base64、sha1,源文件
生活中我们经常会遇到一些加密算法,今天我们就聊聊这些...md5加密算法是不可逆的,所以解密一般都是通过暴力穷举方法,通过网站的接口实现解密。Python代码: import hashlib m = hashlib.md5() m.update(str.enco
1、MD5加密 2、根据CPU硬盘获取机器码 3、加密数据报 4、口令加密BAT、EXE、RAR 5、使用强名称标识软件 6、伪随机数加密 7、文件加密 8、异或加密数字 9、注册码注册机制
尽管MD4算法在安全上有个这么大的漏洞,但它对在其后才被开发出来的好几种信息安全加密算法的出现却有着不可忽视的引导作用。除了MD5以外,其中比较有名的还有sha-1、RIPEMD以及Haval等。 一年以后,即1991年,...
与大家分享几种常用的php加密函数的用法,作者:陈和群。包括了MD5 base64 crypt Sha1等。一些用法说明如下: var_dump(md5('zxcasd',$raw_output=true)); //raw_output为可选参数如果被设置为true那么MD5报文摘要...
Python加密模块有好几个,但无论是哪种加密方式都需要先导入相应的加密模块然后再使用模块对字符串加密。 先导入md5加密所需模块: 复制代码 代码如下: import hashlib 创建md5对象 复制代码 代码如下: m = hashlib....