JavaScript MD5 与 Java MessageDigest 加密后的值相同

JavaScript 数据加密方法:

使用在js中调用MD5(...)方法(在使用方法前先导入下面JS代码){

[html]  view plain copy
  1. function array(n) {  
  2.   for(i=0;i<n;i++) this[i]=0;  
  3.   this.length=n;  
  4. }  
  5.   
  6.   
  7.   
  8. /* Quelques fonctions fondamentales doivent ¨ºtre transform¨¦es ¨¤ cause  
  9.  * d'erreurs Javascript.  
  10.  * Essayez par exemple de calculer 0xffffffff >> 4 ...  
  11.  * Les fonctions utilis¨¦es maintenant sont il est vrai plus lentes que les  
  12.  * fonctions originales mais elles fonctionnent.  
  13.  */  
  14.   
  15. function integer(n) { return n%(0xffffffff+1); }  
  16.   
  17. function shr(a,b) {  
  18.   a=integer(a);  
  19.   b=integer(b);  
  20.   if (a-0x80000000>=0) {  
  21.     a=a%0x80000000;  
  22.     a>>=b;  
  23.     a+=0x40000000>>(b-1);  
  24.   } else  
  25.     a>>=b;  
  26.   return a;  
  27. }  
  28.   
  29. function shl1(a) {  
  30.   a=a%0x80000000;  
  31.   if (a&0x40000000==0x40000000)  
  32.   {  
  33.     a-=0x40000000;  
  34.     a*=2;  
  35.     a+=0x80000000;  
  36.   } else  
  37.     a*=2;  
  38.   return a;  
  39. }  
  40.   
  41. function shl(a,b) {  
  42.   a=integer(a);  
  43.   b=integer(b);  
  44.   for (var i=0;i<b;i++) a=shl1(a);  
  45.   return a;  
  46. }  
  47.   
  48. function and(a,b) {  
  49.   a=integer(a);  
  50.   b=integer(b);  
  51.   var t1=(a-0x80000000);  
  52.   var t2=(b-0x80000000);  
  53.   if (t1>=0)  
  54.     if (t2>=0)  
  55.       return ((t1&t2)+0x80000000);  
  56.     else  
  57.       return (t1&b);  
  58.   else  
  59.     if (t2>=0)  
  60.       return (a&t2);  
  61.     else  
  62.       return (a&b);  
  63. }  
  64.   
  65. function or(a,b) {  
  66.   a=integer(a);  
  67.   b=integer(b);  
  68.   var t1=(a-0x80000000);  
  69.   var t2=(b-0x80000000);  
  70.   if (t1>=0)  
  71.     if (t2>=0)  
  72.       return ((t1|t2)+0x80000000);  
  73.     else  
  74.       return ((t1|b)+0x80000000);  
  75.   else  
  76.     if (t2>=0)  
  77.       return ((a|t2)+0x80000000);  
  78.     else  
  79.       return (a|b);  
  80. }  
  81.   
  82. function xor(a,b) {  
  83.   a=integer(a);  
  84.   b=integer(b);  
  85.   var t1=(a-0x80000000);  
  86.   var t2=(b-0x80000000);  
  87.   if (t1>=0)  
  88.     if (t2>=0)  
  89.       return (t1^t2);  
  90.     else  
  91.       return ((t1^b)+0x80000000);  
  92.   else  
  93.     if (t2>=0)  
  94.       return ((a^t2)+0x80000000);  
  95.     else  
  96.       return (a^b);  
  97. }  
  98.   
  99. function not(a) {  
  100.   a=integer(a);  
  101.   return (0xffffffff-a);  
  102. }  
  103.   
  104. /* D¨¦but de l'algorithme */  
  105.   
  106.     var state = new array(4);  
  107.     var count = new array(2);  
  108.         count[0] = 0;  
  109.         count[1] = 0;  
  110.     var buffer = new array(64);  
  111.     var transformBuffer = new array(16);  
  112.     var digestBits = new array(16);  
  113.   
  114.     var S11 = 7;  
  115.     var S12 = 12;  
  116.     var S13 = 17;  
  117.     var S14 = 22;  
  118.     var S21 = 5;  
  119.     var S22 = 9;  
  120.     var S23 = 14;  
  121.     var S24 = 20;  
  122.     var S31 = 4;  
  123.     var S32 = 11;  
  124.     var S33 = 16;  
  125.     var S34 = 23;  
  126.     var S41 = 6;  
  127.     var S42 = 10;  
  128.     var S43 = 15;  
  129.     var S44 = 21;  
  130.   
  131.     function F(x,y,z) {  
  132.         return or(and(x,y),and(not(x),z));  
  133.     }  
  134.   
  135.     function G(x,y,z) {  
  136.         return or(and(x,z),and(y,not(z)));  
  137.     }  
  138.   
  139.     function H(x,y,z) {  
  140.         return xor(xor(x,y),z);  
  141.     }  
  142.   
  143.     function I(x,y,z) {  
  144.         return xor(y ,or(x , not(z)));  
  145.     }  
  146.   
  147.     function rotateLeft(a,n) {  
  148.         return or(shl(a, n),(shr(a,(32 - n))));  
  149.     }  
  150.   
  151.     function FF(a,b,c,d,x,s,ac) {  
  152.         a = a+F(b, c, d) + x + ac;  
  153.         a = rotateLeft(a, s);  
  154.         a = a+b;  
  155.         return a;  
  156.     }  
  157.   
  158.     function GG(a,b,c,d,x,s,ac) {  
  159.         a = a+G(b, c, d) +x + ac;  
  160.         a = rotateLeft(a, s);  
  161.         a = a+b;  
  162.         return a;  
  163.     }  
  164.   
  165.     function HH(a,b,c,d,x,s,ac) {  
  166.         a = a+H(b, c, d) + x + ac;  
  167.         a = rotateLeft(a, s);  
  168.         a = a+b;  
  169.         return a;  
  170.     }  
  171.   
  172.     function II(a,b,c,d,x,s,ac) {  
  173.         a = a+I(b, c, d) + x + ac;  
  174.         a = rotateLeft(a, s);  
  175.         a = a+b;  
  176.         return a;  
  177.     }  
  178.   
  179.     function transform(buf,offset) {  
  180.         var a=0b=0c=0d=0;  
  181.         var x = transformBuffer;  
  182.   
  183.         a = state[0];  
  184.         b = state[1];  
  185.         c = state[2];  
  186.         d = state[3];  
  187.   
  188.         for (i = 0; i < 16; i++) {  
  189.             x[i] = and(buf[i*4+offset],0xff);  
  190.             for (j = 1; j < 4; j++) {  
  191.                 x[i]+=shl(and(buf[i*4+j+offset] ,0xff), j * 8);  
  192.             }  
  193.         }  
  194.   
  195.         /* tour 1 */  
  196.         a = FF ( a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */  
  197.         d = FF ( d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */  
  198.         c = FF ( c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */  
  199.         b = FF ( b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */  
  200.         a = FF ( a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */  
  201.         d = FF ( d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */  
  202.         c = FF ( c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */  
  203.         b = FF ( b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */  
  204.         a = FF ( a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */  
  205.         d = FF ( d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */  
  206.         c = FF ( c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */  
  207.         b = FF ( b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */  
  208.         a = FF ( a, b, c, d, x[12], S11, 0x6b901122); /* 13 */  
  209.         d = FF ( d, a, b, c, x[13], S12, 0xfd987193); /* 14 */  
  210.         c = FF ( c, d, a, b, x[14], S13, 0xa679438e); /* 15 */  
  211.         b = FF ( b, c, d, a, x[15], S14, 0x49b40821); /* 16 */  
  212.   
  213.         /* tour 2 */  
  214.         a = GG ( a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */  
  215.         d = GG ( d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */  
  216.         c = GG ( c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */  
  217.         b = GG ( b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */  
  218.         a = GG ( a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */  
  219.         d = GG ( d, a, b, c, x[10], S22,  0x2441453); /* 22 */  
  220.         c = GG ( c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */  
  221.         b = GG ( b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */  
  222.         a = GG ( a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */  
  223.         d = GG ( d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */  
  224.         c = GG ( c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */  
  225.         b = GG ( b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */  
  226.         a = GG ( a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */  
  227.         d = GG ( d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */  
  228.         c = GG ( c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */  
  229.         b = GG ( b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */  
  230.   
  231.         /* tour 3 */  
  232.         a = HH ( a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */  
  233.         d = HH ( d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */  
  234.         c = HH ( c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */  
  235.         b = HH ( b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */  
  236.         a = HH ( a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */  
  237.         d = HH ( d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */  
  238.         c = HH ( c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */  
  239.         b = HH ( b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */  
  240.         a = HH ( a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */  
  241.         d = HH ( d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */  
  242.         c = HH ( c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */  
  243.         b = HH ( b, c, d, a, x[ 6], S34,  0x4881d05); /* 44 */  
  244.         a = HH ( a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */  
  245.         d = HH ( d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */  
  246.         c = HH ( c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */  
  247.         b = HH ( b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */  
  248.   
  249.         /* tour 4 */  
  250.         a = II ( a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */  
  251.         d = II ( d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */  
  252.         c = II ( c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */  
  253.         b = II ( b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */  
  254.         a = II ( a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */  
  255.         d = II ( d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */  
  256.         c = II ( c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */  
  257.         b = II ( b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */  
  258.         a = II ( a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */  
  259.         d = II ( d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */  
  260.         c = II ( c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */  
  261.         b = II ( b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */  
  262.         a = II ( a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */  
  263.         d = II ( d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */  
  264.         c = II ( c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */  
  265.         b = II ( b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */  
  266.   
  267.         state[0] +=a;  
  268.         state[1] +=b;  
  269.         state[2] +=c;  
  270.         state[3] +=d;  
  271.   
  272.     }  
  273.     /* Avec l'initialisation de  Dobbertin:  
  274.        state[0] = 0x12ac2375;  
  275.        state[1] = 0x3b341042;  
  276.        state[2] = 0x5f62b97c;  
  277.        state[3] = 0x4ba763ed;  
  278.        s'il y a une collision:  
  279.   
  280.        begin 644 Message1  
  281.        M7MH=JO6_>MG!X?!51$)W,CXV!A"=(!AR71,<X`Y-IIT9^Z&8L$2N'Y*Y:R.;  
  282.        39GIK9>TF$W()/MEHR%C4:G1R:Q"=  
  283.        `  
  284.        end  
  285.   
  286.        begin 644 Message2  
  287.        M7MH=JO6_>MG!X?!51$)W,CXV!A"=(!AR71,<X`Y-IIT9^Z&8L$2N'Y*Y:R.;  
  288.        39GIK9>TF$W()/MEHREC4:G1R:Q"=  
  289.        `  
  290.        end  
  291.     */  
  292.     function init() {  
  293.         count[0]=count[1] = 0;  
  294.         state[0] = 0x67452301;  
  295.         state[1] = 0xefcdab89;  
  296.         state[2] = 0x98badcfe;  
  297.         state[3] = 0x10325476;  
  298.         for (i = 0; i < digestBits.length; i++)  
  299.             digestBits[i] = 0;  
  300.     }  
  301.   
  302.     function update(b) {  
  303.         var index,i;  
  304.   
  305.         index = and(shr(count[0],3) , 0x3f);  
  306.         if (count[0]<0xffffffff-7)  
  307.           count[0] += 8;  
  308.         else {  
  309.           count[1]++;  
  310.           count[0]-=0xffffffff+1;  
  311.           count[0]+=8;  
  312.         }  
  313.         buffer[index] = and(b,0xff);  
  314.         if (index  >= 63) {  
  315.             transform(buffer, 0);  
  316.         }  
  317.     }  
  318.   
  319.     function finish() {  
  320.         var bits = new array(8);  
  321.         var        padding;  
  322.         var        i=0index=0padLen=0;  
  323.   
  324.         for (i = 0; i < 4; i++) {  
  325.             bits[i] = and(shr(count[0],(i * 8)), 0xff);  
  326.         }  
  327.         for (i = 0; i < 4; i++) {  
  328.             bits[i+4]=and(shr(count[1],(i * 8)), 0xff);  
  329.         }  
  330.         index = and(shr(count[0], 3) ,0x3f);  
  331.         padLen = (index < 56) ? (56 - index) : (120 - index);  
  332.         padding = new array(64);  
  333.         padding[0] = 0x80;  
  334.         for (i=0;i<padLen;i++)  
  335.           update(padding[i]);  
  336.         for (i=0;i<8;i++)  
  337.           update(bits[i]);  
  338.   
  339.         for (i = 0; i < 4; i++) {  
  340.             for (j = 0; j < 4; j++) {  
  341.                 digestBits[i*4+j] = and(shr(state[i], (j * 8)) , 0xff);  
  342.             }  
  343.         }  
  344.     }  
  345.   
  346. /* Fin de l'algorithme MD5 */  
  347.   
  348. function hexa(n) {  
  349.  var hexa_h = "0123456789abcdef";  
  350.  var hexa_c="";  
  351.  var hexa_m=n;  
  352.  for (hexa_i=0;hexa_i<8;hexa_i++) {  
  353.    hexa_c=hexa_h.charAt(Math.abs(hexa_m)%16)+hexa_c;  
  354.    hexa_m=Math.floor(hexa_m/16);  
  355.  }  
  356.  return hexa_c;  
  357. }  
  358.   
  359.   
  360. var ascii="01234567890123456789012345678901" +  
  361.           " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"+  
  362.           "[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";  
  363.   
  364. function MD5(message)  
  365. {  
  366.  var l,s,k,ka,kb,kc,kd;  
  367.   
  368.  init();  
  369.  for (k=0;k<message.length;k++) {  
  370.    l=message.charAt(k);  
  371.    update(ascii.lastIndexOf(l));  
  372.  }  
  373.  finish();  
  374.  ka=kb=kc=kd=0;  
  375.  for (i=0;i<4;i++) ka+=shl(digestBits[15-i], (i*8));  
  376.  for (i=4;i<8;i++) kb+=shl(digestBits[15-i], ((i-4)*8));  
  377.  for (i=8;i<12;i++) kc+=shl(digestBits[15-i], ((i-8)*8));  
  378.  for (i=12;i<16;i++) kd+=shl(digestBits[15-i], ((i-12)*8));  
  379.  s=hexa(kd)+hexa(kc)+hexa(kb)+hexa(ka);  
  380.  return s;  
  381. }  

};


Java 中 MessageDigest数据加密方法:

[html]  view plain copy
  1. public static String MD5(String str) throws NoSuchAlgorithmException {  
  2.         String encode = str;  
  3.         StringBuilder stringbuilder = new StringBuilder();  
  4.         MessageDigest md5 = MessageDigest.getInstance("MD5");  
  5.         md5.update(encode.getBytes());  
  6.         byte[] str_encoded = md5.digest();  
  7.         for (int i = 0; i < str_encoded.length; i++) {  
  8.             if ((str_encoded[i] & 0xff) < 0x10) {  
  9.                 stringbuilder.append("0");  
  10.             }  
  11.             stringbuilder.append(Long.toString(str_encoded[i] & 0xff, 16));  
  12.            }  
  13.            return stringbuilder.toString();  
  14.         }  
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
MessageDigest md = MessageDigest.getInstance("SHA1"); String MsgtoDigest="renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao" +"renhl252,dajiahao adjjasasoasoasoadoadao"; //待计算摘要的数据 md.update(MsgtoDigest.getBytes()); //处理摘要 byte[] digest = md.digest(); //计算输出最后的摘要 PrintHex(digest,md.getDigestLength());

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值