<div align="center">
<h1>uuid-readable-rs</h1>
<p>
<strong>Easy to remember unique sentences acting as UUID</strong>
</p>
<p>
[](LICENSE)
[](https://crates.io/crates/uuid-readable-rs)
[](https://docs.rs/uuid-readable-rs)
</p>
</div>
Generate easy to remember sentences that acts as human readable UUIDs.
- Built on UUID v4
- Optionally pass your UUID to derive a sentence from it
- Grammatically _correct_ sentences
- Easy to remember (or at least part of it)
- Size choice (32-bit token or 128-bit token using `short()` or `generate()` respectively)
## Security
This project does not mean to be crypto safe ! **Don't use this as a secure random generator**.
Even if we derive sentences from UUID (that are crypto safe), there can still be some collision
with 2 differents UUID but resulting in the same sentence.
- `25^12` possible combinations for `generate()` (uses 128-bit Token)
- `25^5` possible combinations for `short()` (uses 32-bit Token)
Note that the sentence generated by `generate()` and the original UUID form a bijection, hence no loss of entropy.
## Example
```rust
use uuid::Uuid;
use uuid_readable_rs::{generate_from, short_from, generate, short, generate_inverse};
// You can define your own UUID and pass it to uuid_readable_rs like so
let uuid = Uuid::new_v4();
let sentence_128: String = generate_from(uuid);
let sentence_32: String = short_from(uuid);
// You can also get an UUID from a sentence that was previously generated
let original_uuid: Uuid = generate_inverse(sentence_128).unwrap();
assert_eq!(uuid, original_uuid);
// Or let uuid_readable_rs handle the Uuid generation
let sentence_128: String = generate();
let sentence_32: String = short();
```