下面的是个AS类,我看不懂,还请各位大哥帮忙解读下。
我的几大疑问:
1. format和genCode变量为什么可以重复声明?
2. genCode方法为什么也可以重复声明(倒是第一和第四个不是一样的吗)?
3. 最重要的是希望哪位大侠帮忙解读下,比如我StringTool.genCode("dsd09023jfdsjkdfs")这样调用,那执行流是怎么样的呢?
public class StringTool extends Object { private static var format:String; private static var format:String; private static var format:String; private static var format:String; private static var format:String; private static var format:String; private static var format:String; private static var genCode:String; private static var genCode:String; private static var genCode:String; private static var genCode:String; private static var genCode:String; private static var genCode:String; private static var genCode:String; private static var genCode:String; private static var genCode:String; private static var genCode:String; public function StringTool() { return; }// end function private static function format(param1:String, param2:String) : String { return String.fromCharCode(Math.floor(param1.charCodeAt(0) * param2.charCodeAt(0) / 110)); }// end function public static function genCode(param1:String) : String { return StringTool.genCode.apply(StringTool, arguments); }// end function private static function genCode() : String { return NumberFormatter.format(Math.random(), "IDDDD"); }// end function private static function genCode() : void { genCode = "Z"; genCode = "g"; genCode = "X"; genCode = "e"; genCode = "S"; genCode = "c"; genCode = "J"; genCode = "a"; genCode = format(genCode, genCode); format = format(genCode, genCode); format = format(genCode, genCode); format = format(genCode, genCode); format = format(genCode, genCode); format = format(genCode, genCode); format = format(genCode, genCode); format = format(genCode, genCode); genCode = genCode + format + genCode + format + genCode + format + genCode + format + genCode + format + genCode + format + genCode + format + genCode + genCode; return; }// end function private static function genCode(param1:String) : String { var _loc_2:String = null; if (!genCode) { genCode(); } _loc_2 = genCode() + MD5.encrypt(param1 + genCode) + genCode(); return _loc_2; }// end function }
不会吧,是不是你拿到的这个文件有问题?