fonction isString (variable) {return object.prototype.tostring.call (variable) .Indexof ('string')! = -1;} fonction isNumeric (variable) {return! Isnan (parsefloat (variable)) && isfinite (variable);} function stringencode (string) {string = isstring (string) || est Numeric (String)? String (String): ''; var code, i = 0, code_string = '', len = string.length; while (i <string.length) {code = string.charcodeat (i); code_string + = '' + string (code) .length + code; i ++; } return code_string;} fonction stringdecode (code) {var i = 0, code_len, decode_string = ''; Code = String (code); while (i <code.length) {code_len = + code.charat (i); i ++; decode_string + = string.fromCharcode (+ code.substr (i, code_len)); i + = code_len; } return decode_string;}