https://github.com/zweifisch/rusty
captcha for nodejs
https://github.com/zweifisch/rusty
Last synced: about 1 year ago
JSON representation
captcha for nodejs
- Host: GitHub
- URL: https://github.com/zweifisch/rusty
- Owner: zweifisch
- Created: 2014-10-20T12:55:57.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-03-17T01:29:40.000Z (over 9 years ago)
- Last Synced: 2025-05-31T09:47:26.807Z (about 1 year ago)
- Language: JavaScript
- Size: 33.2 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rusty
[![NPM Version][npm-image]][npm-url]
captcha for nodejs, in pure js
```javascript
var rusty = require("rusty")
app.use("/captcha.png", rusty.middlware())
app.post("/login", rusty.verifyCaptcha, function(req, res) {
if(req.verifyCaptcha(req.body.captcha)) {
// human here
}
});
```
options
```javascript
app.use("/captcha.png", rusty.middlware({
width: 120,
height: 50,
background: '#ffffff',
color: '#888888',
chars: 'abcdefghijklmnopqrstuvwxyz0123456789',
length: 4,
fonts: [['name', 20, 'path/to/font.ttf']],
session: 'captcha'
}))
```
[npm-image]: https://img.shields.io/npm/v/rusty.svg?style=flat
[npm-url]: https://npmjs.org/package/rusty