突然想写一个加密的东西

刚刚看了了 cnbeta 的这篇新闻 “4个终于被破译的世界级密码” http://cnbeta.com/articles/171479.htm

于是自己的突然想写个文字加密的东西玩玩看。

代码逻辑很简单~

[cc lang=”actionscript3″ nowrap=”false”]
var words:String=”abcdefghijklmnopqrstuvwxyz”; //初始化英文字母表
var wordList:Array=[];

for(var i:int=0;i.5?1;-1;
}

encryList.sort(swap); //获取加密数组,其内容为 wordLsit 的乱序排列

//获取的加密数组内容为 encrtList=[“E”,”m”,”b”,”R”,”y”,”x”…];

//之后准备一段文字做测试

var artcile:String=””+
“Using the formula of dot product between Vectors, we can find the angle sandwiched between two vectors. I have included a Flash presentation above to facilitate your understanding. Click on the buttons at the bottom to scroll through the frames.”+

“Here is the Actionscript in Vector2D (which I’ve used in previous tutorials, like this one) that does the job. Note that line 257 helps to determine whether the angle is on the negative or positive side. However, this is not going to help us much here as direction is not important. More explanations on this topic in the next part of this series.”;

var tempArtcile:String=””; //定义临时字符串
var tempArr:Array=[]; //定义临时数组

for(var i:int=0;i

发表评论

电子邮件地址不会被公开。 必填项已用*标注