@tuzhanai/captcha
生成验证码
难度模式 | 示例 |
---|---|
Easy | ![]() |
Medium | ![]() |
Hard | ![]() |
安装
npm install @tuzhanai/captcha -S
使用方法
; ;console.log"验证码:%s,图片Buffer:%s", text, data;
性能
i7-6820HQ CPU @ 2.70GHz 单核每秒可生成约 2W 次验证码
Platform info:- Darwin 18.2.0 x64- Node.JS: 10.13.0- V8: 6.8.275.32-node.36 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz × 8 ┌─────────────┬─────────┬─────────┬────────┐│ test │ rps │ ns/op │ spent │├─────────────┼─────────┼─────────┼────────┤│ Load │ 19546.0 │ 51161.4 │ 2.000s │├─────────────┼─────────┼─────────┼────────┤│ Easy Mode │ 23471.5 │ 42604.9 │ 2.000s │├─────────────┼─────────┼─────────┼────────┤│ Medium Mode │ 22244.0 │ 44955.9 │ 2.000s │├─────────────┼─────────┼─────────┼────────┤│ Hard Mode │ 19785.0 │ 50543.3 │ 2.000s │└─────────────┴─────────┴─────────┴────────┘
License
MIT License Copyright (c) 2018 兔展 Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.