update README

This commit is contained in:
Zongmin Lei
2014-02-20 10:58:29 +08:00
parent 3f131353a2
commit 641b229cfe

View File

@@ -73,7 +73,8 @@ options = {}; // 自定义规则
html = xss('<script>alert("xss");</script>', options); html = xss('<script>alert("xss");</script>', options);
``` ```
如果不想每次都传入一个 `options` 参数,可以创建一个 `FilterXSS` 对象: 如果不想每次都传入一个 `options` 参数,可以创建一个 `FilterXSS` 实例
(使用这种方法速度更快):
``` ```
options = {}; // 自定义规则 options = {}; // 自定义规则
@@ -327,10 +328,10 @@ text: helloend
``` ```
## 性能 ## 性能(仅作参考)
+ xss模块6.01 MB/s + xss模块8.2 MB/s
+ validator@0.3.7模块的xss()函数4.62 MB/s + validator@0.3.7模块的xss()函数4.4 MB/s
测试代码参考 benchmark 目录 测试代码参考 benchmark 目录