mrdimidium / nanoid

A tiny, secure, URL-friendly, unique string ID generator for Rust
https://docs.rs/nanoid
MIT License
545 stars 29 forks source link

Support Regex as character set #2

Closed pepsighan closed 6 years ago

pepsighan commented 6 years ago

Is it possible to use characters from a Regex? Typing each and every custom character takes a while.

mrdimidium commented 6 years ago

Hello. You want alphabet is a regular expression? Why is it necessary? How to use it?

TheIronBorn commented 6 years ago

You can create the alphabet with something like this if that's what you're looking for.

(b'a'..=b'z').chain(b'0'..=b'9').map(|c| c as char).collect()