URL网址16进制加密源码

180it 2021-09-03 PM 2046℃ 0条

URL网址16进制加密源码:

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>URL网址16进制加密工具</title><style>body{ margin:0; text-align:center}textarea{ margin:0; width:60%; height:200px;}</style></head><body>

<p id="sjc" style='color: #C00;margin-top:30px;'><textarea id="contents" name="contents" class="toolarea" placeholder="请把你需要转换的URL粘贴在这里。"></textarea></p>

<input id="zh" type='button' style=' width:200px; height:60px; color: #FFF; background-color:#C30; font-size:20px' value='URL网址16进制加密' onclick="urlCrypt()" />

<script language="javascript">    
    function urlCrypt(){

        var str2='';

        var str = document.getElementById("contents").value;

        var str3 = str.substring(0,7);

        if(str3 == 'http://'){

            str2 = 'http://';

            str = str.substring(7,str.length);

        }
        str3 = str.substring(0,8);

        if(str3 == 'https://'){

            str2 = 'https://';

            str = str.substring(8,str.length);

        }

        for(i=0;i<str.length;i++){

            if(str.charCodeAt(i) == '47') str2 += '/';

            else if(str.charCodeAt(i) == '63') str2 += '?';

            else if(str.charCodeAt(i) == '38') str2 += '&';     

            else if(str.charCodeAt(i) == '61') str2 += '='; 

            else if(str.charCodeAt(i) == '58') str2 += ':'; 

            else str2 += '%'+str.charCodeAt(i).toString(16);

        }

        document.getElementById("contents").value=str2;

        getid('contents').focus();

    }

    </script>
</body>
</html>
支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!

标签: none

URL网址16进制加密源码