JavaScript ¬O¦b¥Î¤áºÝªº¹q¸£°õ¦æ¡A¦ý¬O¦³¨Ç±¡ªp¤U¡A§Ṳ́£§Æ±æ¨Ï¥ÎªÌ§Ûŧ§Ú̺ë¤ß»s§@¥X¨Óªºµ{¦¡½X¡A¦]¦¹´N¦³¥²n¹ï JavaScript µ{¦¡½X¶i¦æ²³æªº«OÅ@©Î¥[±K¡C
º¥ý¡A§ÚÌ¥i¥H¨Ï¥Î escape() ©M unescape() ¨Ó¹ï JavaScript µ{¦¡½X¨Ó¶i¦æ²³æªº¥[±K»P¸Ñ±K¡A½Ð¬Ý¤U¦C¡u¨C¤é¤@¥y¡vªº½d¨Ò¡G
¦b¦¹½d¨Ò¤¤¡A¥un«¸ü¤@¦¸¡A´N·|¥H¶Ã¼Æ¬D¿ï¤@¥y®æ¨¥¡CY¬O¿ï¾ÜÀ˵øì©lÀÉ¡A«h¥u·|¬Ý¨ì¤@°ï¶Ã½X¡A¦p¤U¡G
¦ý¬O¤Wz¶Ã½X¬O¥Ñì¥ý¤u¾ãªºµ{¦¡¸g¥Ñ escape() ½s½Xªºµ²ªG¡AµM«á¸g¥Ñ unescape() ¨Ó±o¦^ì¥ýªº¦r¦ê¡A¦A¥Ñ eval() ¨Ó°õ¦æ¤§¡A¾ãÓ¬yµ{¥i¥H»¡©ú¦p¤U¡G
- ¥ý¼¶¼g¥¼¥[±Kªºì©lºô¶¡C¡]¥»¨Ò¬° randomText.htm¡^
- §Q¥Î escapeEncodeTest01.htm ¨Ó¶i¦æ escape() ªº½s½X¡C
- ±N½s½X«áªº¦r¦ê«þ¨©¨ì¥[±K«áªººô¶¡A¦ý¥²¶·¸g¥Ñ unescape() ¨ÓÂà¦^ì¨Óªºµ{¦¡¦r¦ê¡A¦A¸g¥Ñ eval() ¨Ó°õ¦æ¤§¡CµM«á´N¤j¥\§i¦¨¤F¡C
¦b¤Wz»¡©ú¤¤¡A§Ų́ϥΤF¤@Ó¦n¥Îªººô¶¨Ó¹ï JavaScript µ{¦¡½X¶i¦æ escape() ½s½X¡G
¤Wz½d¨Òªºì©lÀɦp¤U¡G
¦b¤W¤@Ó½d¨Ò¤¤¡A¸g¥Ñ escape() ½s½X«á¡A§AÁÙ¬O¥i¥H¥Ñ½s½X«áªº¦r¦ê¬Ý¨ì½Ñ¦p¡ufunction¡v¡B¡usquare¡vµ¥¦³·N¸qªº¦r²´¡A¦]¦¹¤ñ¸û®e©ö²q¨ìµ{¦¡½Xªº¤º®e¡C¥t¤@ºØ¤èªk¡A«h¬O¥ý±Nµ{¦¡½X¶i¦æ¡u¥²¾½s½X¡v¡]Shift Encoding¡^¡A¦A¶i¦æ escape ½s½X¡A³o®ÉÔ´N¬Ý¤£¨ì¦³·N¸qªº¦r²´¤F¡C½d¨Ò¦p¤U¡G
¤Wz½d¨Ò¤´¬O¡u¨C¤é¤@¥y¡v¡AYÀ˵øì©l½X¡A«h¥u·|¬Ý¨ì¤@°ï¶Ã½X¡A§¹¥þ¨S¦³¦³·N¸qªº¦r²´¦b¸Ì±¡A¦p¤U¡G
²£¥Í¤Wzµ{¦¡½Xªº¬yµ{¥i¥H»¡©ú¦p¤U¡G
- ¥ý¼¶¼g¥¼¥[±Kªºì©lºô¶¡C¡]¥»¨Ò¬° randomText.htm¡^
- §Q¥Î shiftEncodeTest01.htm ¨Ó¶i¦æ shiftEncode() ¤Î escape() ªº½s½X¡C
- ±N½s½X«áªº¦r¦ê«þ¨©¨ì¥[±K«áªººô¶¡A¦ý¥²¶·¸g¥Ñ unescape() ¤Î shiftEncode() ¨ÓÂà¦^ì¨Óªºµ{¦¡¦r¦ê¡A¦A¸g¥Ñ eval() ¨Ó°õ¦æ¤§¡CµM«á´N¤j¥\§i¦¨¤F¡C
¦b¤Wz»¡©ú¤¤¡A§Ų́ϥΤF¤@Ó¦n¥Îªººô¶¨Ó¹ï JavaScript µ{¦¡½X¶i¦æ shiftEncode() ¤Î escape() ½s½X¡G
¤Wz½d¨Òªºì©lÀɦp¤U¡G
¦b¤W¤@Ó½d¨Ò¤¤¡A¸g¥Ñ shiftEncode() ¤Î escape() ½s½X«á¡A§AÁÙ¬O¥i¥H¥Ñ½s½X«áªº¦r¦ê¬Ý¨ì½Ñ¦p¡ugvodujpo¡vµ¥¥²¾¹L«áªº ASCII ¦r¤¸¡AYn§¹¥þÁ׶}³o¨Ç¦r¤¸¡A¥i±N±Nµ{¦¡½X¶i¦æ¡uXOR½s½X¡v¡]XOR Encoding¡^¡A¦A¶i¦æ escape ½s½X¡A½d¨Ò¦p¤U¡G
¤Wz½d¨Ò¤´¬O¡u¨C¤é¤@¥y¡v¡Aì©l½X§ó¥[â¶Ã¡A¦p¤U¡G
²£¥Í¤Wzµ{¦¡½Xªº¬yµ{¥i¥H»¡©ú¦p¤U¡G
- ¥ý¼¶¼g¥¼¥[±Kªºì©lºô¶¡C¡]¥»¨Ò¬° randomText.htm¡^
- §Q¥Î xorEncodeTest01.htm ¨Ó¶i¦æ xorEncode() ¤Î escape() ªº½s½X¡C
- ±N½s½X«áªº¦r¦ê«þ¨©¨ì¥[±K«áªººô¶¡A¦ý¥²¶·¸g¥Ñ unescape() ¤Î xorEncode() ¨ÓÂà¦^ì¨Óªºµ{¦¡¦r¦ê¡A¦A¸g¥Ñ eval() ¨Ó°õ¦æ¤§¡CµM«á´N¤j¥\§i¦¨¤F¡C
¦b¤Wz»¡©ú¤¤¡A§Ų́ϥΤF¤@Ó¦n¥Îªººô¶¨Ó¹ï JavaScript µ{¦¡½X¶i¦æ xorEncode() ¤Î escape() ½s½X¡G
¤Wz½d¨Òªºì©lÀɦp¤U¡G
¦Ó shiftEncode() ¤Î xorEncode() «h©w¸q©ó encode.js¡A¦p¤U¡G
¦³Ãö©ó¥»¸`©Ò¤¶²Ðªº½s½X»P¸Ñ½Xªº¤èªk¡A¥i¥H¦Cªí¦p¤U¡G
¬ÛÃö¨ç¼Æ | ½s½X¤è¦¡ | ¸Ñ½X¤è¦¡
|
---|
escape() ©M unescape() | escape(ì¦r¦ê) | unscape(½s½X«á¦r¦ê)
|
shiftEncode() | shiftEncode(ì¦r¦ê, ¥²¾¶q) | shiftEncode(½s½X«á¦r¦ê, -¥²¾¶q)
|
xorEncode() | xorEncode(ì¦r¦ê, XOR¦r¦ê) | xorEncode(½s½X«á¦r¦ê, XOR¦r¦ê)
|
·íµM¹Æ¡A¦P¾ÇÌÁÙ¥i¥H·Q¥X§ó½ÆÂøªº½s½X»P¸Ñ½X¨ç¦¡¡A¨Ó«OÅ@§Aªºµ{¦¡½X¡C¦ý¬O³o¨Ç«OÅ@¤è¦¡¡AÁÙ¬O¥u¨¾§g¤l¡A¤£¨¾¤p¤H¡A¦]¬°¹ï©ó¥\¤O°ª²`ªº¦³¤ß¤H¨Ó»¡¡AÁÙ¬O¥i¥H©âµ·éõ¦aºCºC¯}¸Ñ§Aªº½s½X¹Lµ{¡C
JavaScript µ{¦¡³]p»PÀ³¥Î¡G¥Î©óºô¶¥Î¤áºÝ