brute

package module
v0.0.0-...-f29b25c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2021 License: MIT Imports: 1 Imported by: 0

README

go-brute Go Reference

A bruteforce combination generator for a specific character set

Example

characterSer := []rune("AB")
minLen := 1
maxLen := 2
b, _ := Brute(characterSer, minLen, maxLen, 4)
for combination := range b {
	fmt.Println(combination)
}
// Output:
// A
// B
// AA
// AB
// BA
// BB

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Brute

func Brute(charset []rune, minLen, maxLen, buffer int) (combos <-chan string, closer func())

Brute returns a channel of all possible combinations of a characterset. charset is the characterset to be used, minLen is the minimum length of combinations and should be greater than 0 it will panic otherwise, maxLen is the maxmimum length of combinations and should be greater than or equal to minLen, otherwise it will panic buffer specifies the buffer size of the returned channel, closer can be called to terminte the generator

Example
characterSer := []rune("AB")
minLen := 1
maxLen := 2
b, _ := Brute(characterSer, minLen, maxLen, 4)
for combination := range b {
	fmt.Println(combination)
}
Output:

A
B
AA
AB
BA
BB

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL