Skip to content

human-readable random url #152

Description

@mokurin000

Example program:

use cgisf_lib::SentenceConfigBuilder;

fn main() {
    let sentence = cgisf_lib::gen_sentence(
        SentenceConfigBuilder::random()
            .plural(false)
            .adjectives(1)
            .adverbs(1)
            .structure(cgisf_lib::Structure::AdjectivesNounVerbAdverbs)
            .build(),
    );
    let sentence = sentence
        .replace("The ", "")
        .trim_end_matches(".")
        .replace(" ", "-");
    println!("{sentence}");
}

Would output things like:

rust-kiss-alarms-stealthily

Compared to traditional random hash strings (e.g., "GSlZNwBUGKi"), it achieves semantic structural composition with these advantages:

  • Memorability - Uses natural language elements (adjective+noun+verb+adverb) that align with human memory patterns.
  • Readability - Word combinations form pseudo-sentence structures (e.g., "rust-kiss-alarms-stealthily" could be interpreted as "rusty kisses stealthily alarm").

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions