Crates.io | recaptcha |
lib.rs | recaptcha |
version | 0.5.0 |
source | src |
created_at | 2015-02-20 13:05:09.903802 |
updated_at | 2021-06-26 19:46:26.481818 |
description | recaptcha response verification |
homepage | |
repository | https://github.com/panicbit/recaptcha-rs |
max_upload_size | |
id | 1430 |
size | 7,481 |
Recaptcha-rs is a very simple library to verify recaptcha responses.
To use recaptcha-rs in your project you can add the following to your Cargo.toml
:
[dependencies]
recaptcha = "0.5.0"
Verifying recaptcha responses is very easy:
extern crate recaptcha;
fn main() {
let remote_ip = "123.123.123.123".parse().ok();
let res = recaptcha::verify("your_private_key", "user_response", remote_ip).await;
if res.is_ok() {
println!("Success");
} else {
println!("Failure");
}
}