/* 
* Convert an array of little-endian words to a base-64 string 
*/ 
function binl2b64(binarray) 

var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 
var str = ""; 
for(var i = 0; i < binarray.length * 4; i += 3) 

var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16) 
| (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 ) 
| ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF); 
for(var j = 0; j < 4; j++) 

if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; 
else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); 


return str; 

解决方案 »

  1.   

    下面是接收代码,我只是不知到他怎么加密到action中如:action=79759fef-b6b1-440b-9446-f3031cb81371
    ,如何接收action
    =============================
    <script language=javascript>
    var password=hex_md5(newform.pwd.value);
    document.write(password);
    </script>
      

  2.   

    <form method="post" action="login.asp" name="newform">
    <input name="username">
    <input type="password" name="pwd" >
    <input type="button" onclick="javascript:this.form.submit();">
    </form>
      

  3.   

    <form   method="post"   action="login.asp"   name="newform"> 
    <input   name="username"> 
    <input   type="password"   name="pwd"> 
    <input   type="button"   onclick="jiami(this.form);"> 
    </form> 
    <script>
    //把原来的值改为加密后的值在提交表单
    function jiami(f)
    {
      f.username.value=hex_md5(f.username.value);
      f.pwd.value=hex_md5(f.pwd.value);
      f.submit();//提交表单
    }
    </script>