Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

MD5 javascript

 /*****************************************************************************
* md5.js
*
* A JavaScript implementation of the RSA Data Security, Inc. MD5
* Message-Digest Algorithm.
*
* Copyright (C) Paul Johnston 1999. Distributed under the LGPL.
*****************************************************************************/
/* to convert strings to a list of ascii values */
var sAscii = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"
var sAscii = sAscii + "[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
/* convert integer to hex string */
var sHex = "0123456789ABCDEF";
function hex(i) {
h = "";
for(j = 0; j <= 3; j++) {
h += sHex.charAt((i >> (j * 8 + 4)) & 0x0F) +
sHex.charAt((i >> (j * 8)) & 0x0F);
}
return h;
}
/* add, handling overflows correctly */
function add(x, y) {
return ((x&0x7FFFFFFF) + (y&0x7FFFFFFF)) ^ (x&0x80000000) ^ (y&0x80000000);
}
/* MD5 rounds functions */
function R1(A, B, C, D, X, S, T) {
q = add(add(A, (B & C) | (~B & D)), add(X, T));
return add((q << S) | ((q >> (32 - S)) & (Math.pow(2, S) - 1)), B);
}
function R2(A, B, C, D, X, S, T) {
q = add(add(A, (B & D) | (C & ~D)), add(X, T));
return add((q << S) | ((q >> (32 - S)) & (Math.pow(2, S) - 1)), B);
}
function R3(A, B, C, D, X, S, T) {
q = add(add(A, B ^ C ^ D), add(X, T));
return add((q << S) | ((q >> (32 - S)) & (Math.pow(2, S) - 1)), B);
}
function R4(A, B, C, D, X, S, T) {
q = add(add(A, C ^ (B | ~D)), add(X, T));
return add((q << S) | ((q >> (32 - S)) & (Math.pow(2, S) - 1)), B);
}
/* main entry point */
function calcMD5(sInp) {
/* Calculate length in machine words, including padding */


Ïà¹ØÎĵµ£º

¶ÔJavaScriptµÄһЩÈÏʶ

¶ÔÓÚJavaScriptÀ´½²£¬ËüµÄ³öÏÖʹµÃÐÅÏ¢ºÍÓû§Ö®¼ä²»½öÖ»ÊÇÒ»ÖÖÏÔʾºÍä¯ÀÀµÄ¹Øϵ£¬¶øÊÇʵÏÖÁËÒ»ÖÖʵʱµÄ¡¢¶¯Ì¬µÄ¡¢¿É½»Ê½µÄ±í´ïÄÜÁ¦¡£×î½üС±àÕûÀíÁËһЩ×ÊÁÏ£¬·¢²¼ÉÏÀ´Óë´ó¼ÒÒ»Æð·ÖÏí£¬Èç¹ûÎÄÕÂÓÐʲô覴û¹Ï£Íû¸ßÊÖÖ¸µã£¬´ó¼ÒÏ໥ѧϰ¡£
JavaScriptÊÇÒ»ÖÖ»ùÓÚ¶ÔÏó(Object)ºÍʼþÇý¶¯(Event Driven)²¢¾ßÓа²È«ÐÔÄܵĽű¾Óï ......

javascript event ʼþ½âÎö

 ÃèÊö event´ú±íʼþµÄ״̬£¬ÀýÈç´¥·¢event¶ÔÏóµÄÔªËØ¡¢Êó±êµÄλÖü°×´Ì¬¡¢°´ÏµļüµÈµÈ¡£ event¶ÔÏóÖ»ÔÚʼþ·¢ÉúµÄ¹ý³ÌÖвÅÓÐЧ¡£  eventµÄijЩÊôÐÔÖ»¶ÔÌض¨µÄʼþÓÐÒâÒå¡£±ÈÈ磬fromElement ºÍ toElement ÊôÐÔÖ»¶Ô onmouseover ºÍ  onmouseout ʼþÓÐÒâÒå¡£ Àý×Ó ÏÂÃæµÄÀý×Ó¼ì²éÊó±êÊÇ·ñÔÚÁ´½ÓÉ ......

ie firefox javascript

 1.document.formName.item("itemName") ÎÊÌâ
˵Ã÷:IEÏÂ,¿ÉÒÔʹÓÃdocument.formName.item("itemName")»ò document.formName.elements["elementName"];FirefoxÏÂ,Ö»ÄÜʹÓà document.formName.elements["elementName"].
½â¾ö·½·¨:ͳһʹÓÃdocument.formName.elements["elementName"].
2.¼¯ºÏÀà¶ÔÏóÎÊÌâ
˵Ã÷:IEÏÂ,¿É ......

javascriptÊ®½øÖÆת¶þ½øÖÆ£¬¶þ½øÖÆתʮ½øÖÆ


alert(parseInt("101101", 2))

ÔËÐдúÂë

function toBin(intNum) {
var answer = "";
if(/\d+/.test(intNum)) {
while(intNum != 0) {
answer = Math.abs(intNum%2)+answer;
intNum = parseInt(intNum/2);
}
......

ÓÃJavaScriptʵÏÖä¯ÀÀÆ÷״̬À¸·ÉÈëÎÄ×Ö

 //״̬À¸·ÉÈëÎÄ×Ö
function statusMessageObject(p,d) {  <!--????????????-->
  this.msg = MESSAGE
  this.out = " "
  this.pos = POSITION
  this.delay = DELAY
  this.i     = 0
  this.reset = clearMessage
}
function clearMessage( ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ