44 releases (4 stable)

1.1.2 Feb 5, 2026
0.9.4 Dec 26, 2025
0.9.3 Oct 12, 2025
0.8.4 Jul 31, 2025
0.3.1-beta Oct 27, 2020

#260 in Algorithms

Download history 2/week @ 2025-11-20 39/week @ 2025-11-27 7/week @ 2025-12-04 71/week @ 2026-01-01 81/week @ 2026-01-08 59/week @ 2026-01-15 63/week @ 2026-01-22 74/week @ 2026-01-29 104/week @ 2026-02-05 90/week @ 2026-02-12 3/week @ 2026-02-19 41/week @ 2026-02-26

261 downloads per month

MIT license

250KB
10K SLoC

Twistr — Build & Test Status docs crates.io Discord invite

Twistr is a domain name permutation library powered by Rust. It aims to directly port the well-known dnstwist tool allowing for fast and flexible interfacing capabilities with the core libraries based on client's requirements.







Quickstart

This is particularly helpful if you're from outside the Rust space and would like to get up and running quickly.

  1. Install Rust
  2. git clone https://github.com/JuxhinDB/twistrs.git
  3. cd examples/twistrs-cli
  4. cargo r -- github.com

Keep in mind that this will not run with a release build and will be naturally slower, however it should allow you to explore some of the functionality.

Usage

The core library is composed of the domain permutation module.

use twistrs::filter::Permissive;
use twistrs::permutate::Domain;

fn main() {
    let domain = Domain::new("google.com").unwrap();
    for permutation in domain.all(&Permissive) {
        println!("{} {:?}", permutation.domain.fqdn, permutation.kind);
    }
}

Allocation-free API

For high-throughput use cases, use the visitor API to avoid allocating a new String/Domain per permutation:

use twistrs::filter::Permissive;
use twistrs::permutate::Domain;

fn main() {
    let domain = Domain::new("google.com").unwrap();
    domain.visit_all(&Permissive, |p| {
        println!("{} {:?}", p.domain.fqdn, p.kind);
    });
}

Features

  • Granular control over permutation algorithms (e.g. homoglyphs)
  • Allocation-free visitor API (Domain::visit_all)
  • Exceptionally fast end-to-end results
  • Core library allowing easy extensions (i.e. CLI, API & streams)

Miscellaneous


Frequently Asked Questions

Q: If I want to use a different set of dictionaries to the one provided out of the box by the libary, how can I achieve that?

A: Currently the library (for ease-of-use) bakes the dictionaries into the final binary through a build script. To customise this, you would need to update the relevant files under twistrs/data and compile the library using cargo b or cargo b --release. You can also reference the library in your own Cargo.toml, pointing to a local copy.

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Twistrs by you, shall be licensed as MIT, without any additional terms or conditions.


lib.rs:

Twistrs is a domain name permutation library.

The library is designed to be fast, modular and easy-to-use for clients.

The primary struct to look into is Domain.

Example

use twistrs::{
  permutate::{Domain},
  filter::Permissive,
};
let domain = Domain::new("google.com").unwrap();
let permutations = domain.all(&Permissive).collect::<Vec<_>>();
assert!(!permutations.is_empty());

Dependencies

~4.5MB
~139K SLoC