mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-13 11:05:40 +00:00
domain verification
This commit is contained in:
@@ -21,3 +21,17 @@ pub mod levels;
|
||||
pub mod mcaptcha;
|
||||
|
||||
pub use super::auth::is_authenticated;
|
||||
|
||||
pub fn get_random(len: usize) -> String {
|
||||
use std::iter;
|
||||
|
||||
use rand::{distributions::Alphanumeric, rngs::ThreadRng, thread_rng, Rng};
|
||||
|
||||
let mut rng: ThreadRng = thread_rng();
|
||||
|
||||
iter::repeat(())
|
||||
.map(|()| rng.sample(Alphanumeric))
|
||||
.map(char::from)
|
||||
.take(len)
|
||||
.collect::<String>()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user