Generate permutations & combinations

Related tags

Miscellaneous pincer
Overview

Pincer

Generate permutations and combinations of sets of elements.

Inspired by crunch.

Usage:

Multiple functions are provided with this Rust library.

Each function has built-in documentation when hovered.

The from_pattern() function is the most complicated, using a set of symbols to iterate letters, numbers and symbols.

, for all uppercase letters
@ for all lowercase letters
% for all numeric characters
^ for all special characters

Here are the characters represented, respectively:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 8 9
  ! " # $ % ( ) * + , ' - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~  

An example function input and output:

for s in from_pattern(vec!['a', '%', '@'], None) {
    println!("{}", s);
}
// Output: a0a, a0b, a0c ... a1a, a1b, a1c ... a9x, a9y, a9z

Notes

For planned features, to suggest a feature or to report a bug, please see the Github issues tab. Pull requests with new features are also welcome!

Optimisations to the functions will come in future. For now, they get the job done.

You might also like...
Generate beautiful changelogs from your Git commit history

clog-cli A conventional changelog for the rest of us About clog creates a changelog automatically from your local git metadata. See the clogs changelo

Generate CPU FlameGraphs based on DWARF Debug Info

torch A script that glues perf CPU sampling and Brendan Gregg's visualizer to generate FlameGraphs. Requirements Usage Examples License Requirements L

Generate PDF files with JavaScript and WASM (WebAssembly)

WASM-PDF Generates PDF files directly in the browser with JavaScript and WASM (WebAssembly). Idea here is to push all the work involved in creating a

(Read-only) Generate n-grams

N-grams Documentation This crate takes a sequence of tokens and generates an n-gram for it. For more information about n-grams, check wikipedia: https

A tool to generate inbetweens for animated sprites, written in godot-rust
A tool to generate inbetweens for animated sprites, written in godot-rust

Bitmapflow is a tool to help you generate inbetweens for animated sprites. In other words, it makes your animations smoother. It uses optical flow to

Generate unique, yet sortable identifiers

ulid-lite About An implementation of the ULID ("Universally Unique Lexicographically Sortable Identifier") standard. A ULID is 128-bit compatible with

Generate a Python module from a single Rust file.

cargo-single-pyo3 Utility to build Python modules from a single Rust files via pyo3. Inspired by cargo-single. Installation cargo install cargo-single

Some bunch of test scripts to generate a SQLite DB with 1B rows in fastest possible way

To find out the fastest way to create an SQLite DB with 1B random rows.

This crate provides a convenient macro that allows you to generate type wrappers that promise to always uphold arbitrary invariants that you specified.

prae This crate provides a convenient macro that allows you to generate type wrappers that promise to always uphold arbitrary invariants that you spec

Generate short, memorable phrases for throw-away names.

Generates three-word phrases of the form intensifier-adjective-noun, just like GitHub default repo names.

Generate markdown footer links.

WIP Generate markdown footer links.

A Matrix bot which can generate
A Matrix bot which can generate "This Week in X" like blog posts

hebbot A Matrix bot which can help to generate periodic / recurrent summary blog posts (also known as "This Week in X"). The bot was inspired by twim-

Hypergraph is a data structure library to generate directed hypergraphs.

Hypergraph is data structure library to create a directed hypergraph in which a hyperedge can join any number of vertices.

Generate manual pages from mdBooks!

mdbook-man Generate man pages from mdBooks! Usage To use mdbook-man you'll first need to install it with: $ cargo install mdbook-man And add the follo

Crate to generate files in ROFF format (Rust)

roffman A crate to generate roff man pages. Usage Add the following to the Cargo.toml: [dependencies] roffman = "0.3" Example use roffman::{Roff, Roff

git-cliff can generate changelog files from the Git history by utilizing conventional commits as well as regex-powered custom parsers.⛰️
git-cliff can generate changelog files from the Git history by utilizing conventional commits as well as regex-powered custom parsers.⛰️

git-cliff can generate changelog files from the Git history by utilizing conventional commits as well as regex-powered custom parsers. The changelog template can be customized with a configuration file to match the desired format.

Generate easy to remember sentences that acts as human readable UUIDs 🥳

uuid-readable-rs Easy to remember unique sentences acting as UUID Generate easy to remember sentences that acts as human readable UUIDs. Built on UUID

🧵 Generate self-describing strings of a given length to help aid software testing
🧵 Generate self-describing strings of a given length to help aid software testing

rust-counter-strings Counter strings generator written in rust to help aid software testing What is a counterstring? "A counterstring is a graduated s

Securely generate API tokens for third-party access to your Tesla.

Tesla Auth Securely generate API tokens for third-party access to your Tesla. Multi-factor authentication (MFA) and Captcha are supported. Download Pr

Comments
  • v1.0.0

    v1.0.0

    Added pattern permutations. Updated README. Renamed functions, files. Bump to version major number.

    Co-Authored-By: Kattaras [email protected]

    opened by Sheumais 0
Owner
Student learning Rust & contributing on Github!
null
Generate markdown footer links.

WIP Generate markdown footer links.

Arijit Basu 8 Nov 20, 2022
Generate manual pages from mdBooks!

mdbook-man Generate man pages from mdBooks! Usage To use mdbook-man you'll first need to install it with: $ cargo install mdbook-man And add the follo

Wojciech Kępka 22 Oct 6, 2022
Rust crate to generate, manipulate and traverse trees.

SOCAREL Rust crate to generate, manipulate and traverse trees. It provides iterators for eight different traversal algorithms. Add and remove nodes in

Andreu 8 Nov 14, 2021
Generate nginx vhosts for mlcdf/cc-reverve-proxy

nvhosts Generate nginx vhosts given a configuration file. Made to work with mlcdf/cc-reverse-proxy. Usage Usage: nvhosts [-c <config>] [--example] [-V

Maxime Le Conte des Floris 0 Feb 28, 2022
Here are a few cargo-generate templates for use when creating bevy applications

Bevy-template-rs Here are a few cargo-generate templates for use when creating bevy applications. Templates Game This is a template for starting a new

Johnny Tidemand Vestergaard 19 Nov 4, 2022
Ampseer examines reads in fastq format and identifies which multiplex PCR primer set was used to generate the SARS-CoV-2 sequencing library they are read from.

Ampseer examines reads in fastq format and identifies which multiplex PCR primer set was used to generate the SARS-CoV-2 sequencing library they are read from.

New England Biolabs Inc. 7 Nov 2, 2022
Generate "programmatic" lists in Mastodon

mastodon-list-bot Oh no, the evil algorithm is back! A small program to generate "programmatic" lists in Mastodon, as a way to experiment with differe

Markus Unterwaditzer 3 Oct 16, 2023
Tiny Rust crate to iterate bit combinations

bit_combi_iter bit_combi_iter is a small dependency-free crate to enumerate all bit combinations less than given unsigned integer value keeping 1s in

Linda_pp 5 Apr 11, 2022
Generating Permutations with Rust

rust_permutations Generating Permutations with Rust Permutation Input: a string of unknown length that can contain only three characters: 0, 1, or . F

Flavio Rasseli 1 Oct 25, 2021
A simple to use rust package to generate or parse Twitter snowflake IDs,generate time sortable 64 bits unique ids for distributed systems

A simple to use rust package to generate or parse Twitter snowflake IDs,generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)

houseme 5 Oct 6, 2022