前端智勇大闯关-第二季-第三题
10的世界在我们的世界里,字母A很好理解键盘兄表示65无压力CPU表示01000001才是王道1、题目中描述的三句话:二进制与十进制与A之间的相互转换
2、在textarea元素中包含了一长串的二进制编码(0和1的世界)3、下图展示由二进制码转换成字母的过程每八位一组由二进制转化十进制,由十进制找到对应的asc码,将这些asc码每四个组成一组,再转换成十进制,最后,把十进制转成成asc码,对应的字母相应的就出来了。。。4、详细代码
var str = "0011000000110000001101100011100000110000001100000011011100110100001100000011000000110111001101000011000000110000001101110011 000000110000001100000011001101100001001100000011000000110010011001100011000000110000001100100110011000110000001100000011011100110111001 10000001100000011011100110111001100000011000000110111001101110011000000110000001100100110010100110000001100000011011000110011001100000 01100000011011001100101001100000011000000110110001100100011000000110000001101100110001100110000001100000011011001100110001100000011000 00011011000110111001100000011000000110111001100110011000000110000001100100110010100110000001100000011011000110011001100000011000000110 11001100110001100000011000000110110011001000011000000110000001100100110011000110000001100000011011001100010001100000011000000110111001 1010100110000001100000011011000111001001100000011000000110110011000100011000000110000001101110011010100110000001100000011011000111001";var mstr = "",nstr="";for(var i=0;i
接下来,分析分析这个题目是怎么实现的,知道答案了,其实是一个逆过程。
目标:由字符转换成二进制码详细代码:var str = "http://www.cnblogs.com/kuikui";var marr = new Array(),narr= new Array(),parr=new Array();var mstr = ""; for(var i = 0;i