profaneword

package module
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 8 Imported by: 0

README

profane gopher Go Report Card PkgGoDev Maintainability GitHub License

profane password generator, as suggested by u/gatestone.

how it works

install:

go install github.com/MikkelHJuul/profaneword/profaneword@latest

play

❯ profaneword
shagg'n is mandatory!?

❯ while true; do profaneword;done
Nastile? Enslaving!?
nakedle = Prick-Fucking!
Unwant'N Vs anal-secreten!
Lick'N-Fucker! bollox...NOT!
jizz'n Of Rile 8===D
serial-killer chilly?
strangling < Nut-Sack 8===D
degenerate - satanicalli-fucking!
tediousness: overgrowth-fucking!
Brutalle < Dolefulness-Fucker!
baddie FU
Unforgiving = aggressively!
Excommunicaten > 8===D--pesky
Unjustifi'D Imp
sex-butt-sex Sinned!!
Degenerate!? Poop'N!?
Spooky > Sex-Rild!
drowsy!? Dung
Loner => sex-passivation!
Henchman?! angrile
Soggy 8===D Tripp'N 8===D
^C

~ 
❯ profaneword --extend
Dix Ogre - Pit

~ 
❯ profaneword --EXTEND
Enviousle Homicidally Lustillee Fuck'D Vs. Jerkass

~ 
❯ profaneword 1337
5uccum81n'? p4551v4710n-fuck3r!

~ 
❯ profaneword uber1337
|V@~/_| -> |V(_))3

~ 
❯ profaneword --extend /s
dimwitted? stIcKy PIrATes

~ 
❯ profaneword --extend randomly 1337 /s
DarEdEvils -> aDUlteRaTED p17Y-fuckR5

~ 
❯ profaneword --extend randomly random uber1337 /s
hOR2!B|3 3|V§|@\/eN, sEX-DEaTh!

~ 
❯ profaneword --extend SCREAM fst
SECLUSIO - UNFORIVING RCTM

~ 
❯ profaneword fat
Infertiliry-Fucker! Haram

~ 
❯ profaneword random fst whisper
badmoth'd - poopig

❯ profaneword randomly esrever
Tired noitavissap

~
❯ profaneword -d "_?"
Passivat'D_?Vs_?Hazile

~ 
❯ profaneword -d RAND
succumb?!.Infertile

~ 
❯ profaneword -d RAND
sissy+is+Excommunication

~ 
❯ profaneword --no MISSPELL
Awkwardly? sex-exacerbate!

~ 
❯ profaneword swear
*%"%$@$&+!e %"!s +@*%*+&$!?

❯ profaneword randomly horse
saddlebags sex-lowsy

~ 
❯ profaneword studder
v-v-v-vomittin' i-is torture!

❯ profaneword studder randomly shuffle
F-FU!? n-coiS-A-RSSO-fS-te-  #S-S-S-Son-Of-A-R*

~ 
❯ profaneword --help
profaneword is a program for generating obscene/profane passwords.

Usage:
  profaneword [flags] [..args]
  profaneword [command]

Available Commands:
  completion  generate the autocompletion script for the specified shell
  help        Help about any command
  obscure     apply formatters on std in
  version     print the version and exit

Flags:
      --EXTEND                lengthen the output further (extensiveness+3)
  -d, --delimiter string      a specific delimiter to use, or 'RAND' for a randomly chosen one from: '.-/_:$%^+=!@'`,|<>"~\?*&' (default " ")
      --extend                lengthen the output (extensiveness+1)
  -e, --extensiveness int16   how long (number of words) the password should be. Default is 2 (default 2)
  -h, --help                  help for profaneword
      --no string             exclude types of words: can be MISSPELL, POSITIVE or a '|' separated text of those

Args[formatters]:
  1337            output formatted as 1337-speak
  uber1337        output formatted with an extended 1337 alphabet
  fat             output some t3xt wifth fat fringers
  fst             otput sme tet writen wit haste
  esrever         desrever tuptuo, per word [random does not apply]
  shuffle         tuoput si ffudlehs
  SCREAM          OUTPUT IS UPPERCASE
  whisper         output is lowercased
  swear           output cartoonish #%$@!! 
  studder         o-o-output s-s-s-studdering t-text [random does not apply]
  horse           just output horse-related words in stead[very unsafe] [random does not apply]
  /s              sARcaSTiC OUtpUt
	
  randomly        the next formatter is applied only randomly (per word basis) threshold is 50:50
  random          the next formatter is applied only randomly (per character basis) threshold is 50:50
                  both "random" and "randomly" are chainable onto themselves, 
                  though "randomly" must be before "random"


Use "profaneword [command] --help" for more information about a command.

~ 

all formatters available with obscure, examples

❯ echo 'a quick brown fox jumps over the lazy dog' | profaneword obscure studder randomly shuffle
a -u-kciqqq wrnbo f-fx-ffo- mpusj -roove t-he-t-tt l-lazy d-d-dog

~ 
❯ echo 'a quick brown fox jumps over the lazy dog' | profaneword obscure studder
a-a-a-a q-q-quick brown f-f-f-fox j-j-jumps over t-t-the l-lazy d-d-d-dog

~ 
❯ echo 'a quick brown fox jumps over the lazy dog' | profaneword obscure fst
ic brown ox umpsove the lay dog

~ 
❯ echo 'a quick brown fox jumps over the lazy dog' | profaneword obscure fat
a quick berian fox jumps over the lazyt dog

~ 
❯ echo 'a quick brown fox jumps over the lazy dog' | profaneword obscure randomly 1337 randomly uber1337
a ()_|_|!<|< !312()'//|\| f0x jumps over 7]-[3 lazy dog

~ 
❯ echo 'a quick brown fox jumps over the lazy dog' | profaneword obscure randomly 1337 /s
4 QuicK 8r0WN f0x JUMp5 oVEr the 142y D06

~
❯ echo 'a quick brown fox jumps over the lazy dog' | profaneword -d RAND obscure
a%quick%brown%fox%jumps%over%the%lazy%dog

~ 

Statistics

The file data_report_test.go computes the number of combinations:

for...

  • for 1 word there will be 58 thousand combinations and on average 8.16 letters in each word
  • 2 words there will be 6.88 billion combinations and on average 8.21 letters in each word
  • 3 words there will be 811.89 trillion combinations and on average 8.21 letters in each word

These numbers refer to the database level

formatters:

  • Title is always ON, and virtually doubles the number of combinations
  • whisper removes the combinations added by title.
  • SCREAM adds 1 more combination of each word.
  • /s increase combinations by a lot (2^(8*n) - the length of the word times number of words) whisper and SCREAM are special (very rare) combinations of /s
  • random/randomly for /s it simply makes the uncommon possibilities a lot more common,
  • fat and fst both increase the combinations by a lot. Again random/randomly just changes the distribution of the possible outcomes.
  • 1337 adds one combination, random 1337 adds a lot of combinations (2^(~3*n)).
  • uber1337 adds many combinations, random uber1337 adds a lot of combinations onto those.
  • using --no MISSPELL reduces combinations significantly.
  • using --weird adds a lot of combinations

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CharFormatter

type CharFormatter interface {
	FormatRune(rune) []rune
}

CharFormatter is a formatter that emits a slice of runes given a single rune.

type CharFormatterDelegatingFormatter

type CharFormatterDelegatingFormatter struct {
	CharFormatter
}

CharFormatterDelegatingFormatter is a Formatter that delegates each letter in the input to a CharFormatter

func (*CharFormatterDelegatingFormatter) Format

Format calls the wrapped CharFormatter's FormatRune-method

func (*CharFormatterDelegatingFormatter) GetCharFormatter added in v0.6.1

func (c *CharFormatterDelegatingFormatter) GetCharFormatter() CharFormatter

GetCharFormatter returns the wrapped CharFormatter, which is delegated to

func (*CharFormatterDelegatingFormatter) SetCharFormatter added in v0.6.1

func (c *CharFormatterDelegatingFormatter) SetCharFormatter(formatter CharFormatter)

SetCharFormatter sets the CharFormatter to be wrapped by CharFormatterDelegatingFormatter

type CryptoRand

type CryptoRand struct{}

func (CryptoRand) Rand

func (c CryptoRand) Rand() *big.Rat

func (CryptoRand) RandMax

func (c CryptoRand) RandMax(max int) int

type FastFingerCharFormatter

type FastFingerCharFormatter struct {
	RandomDevice
}

FastFingerCharFormatter formats as if written with haste, skipping characters at random

func (FastFingerCharFormatter) FormatRune

func (ff FastFingerCharFormatter) FormatRune(r rune) []rune

FormatRune at a rate of 1/6 randomly skip a rune

type FatFingerCharFormatter

type FatFingerCharFormatter struct {
	RandomDevice
}

FatFingerCharFormatter formats the text/rune as if it was types with fat fingers

func (FatFingerCharFormatter) FormatRune

func (ff FatFingerCharFormatter) FormatRune(r rune) []rune

FormatRune returns the slice of runes by finding the neighboring characters (keyboard) and returns a random set of characters from within that sequence. it may return the rune itself up to four times

type Formatter

type Formatter interface {
	Format(string) string
}

Formatter is a formatter, that formats the entire input text(string) and outputs the formatted text

func DelimiterFormatterWith

func DelimiterFormatterWith(repl string) Formatter

DelimiterFormatterWith replaces all spaces with the given string

func L337Formatter

func L337Formatter() Formatter

L337Formatter returns a L337CharFormatter with a predefined mapping, the l337map

func NewFastFingerFormatter

func NewFastFingerFormatter() Formatter

NewFastFingerFormatter returns an initiated FastFingerCharFormatter wrapped in a CharFormatterDelegatingFormatter to produce a Formatter

func NewFatFingerFormatter

func NewFatFingerFormatter() Formatter

NewFatFingerFormatter wraps the FatFingerCharFormatter in a CharFormatterDelegatingFormatter to produce a Formatter

func NewHorseFormatter added in v0.7.1

func NewHorseFormatter() Formatter

NewHorseFormatter returns a PerWordFormattingFormatter wrapping a HorseFormatter

func NewLowercaseFormatter added in v0.7.1

func NewLowercaseFormatter() Formatter

func NewRandomlyFormatter

func NewRandomlyFormatter(wrap Formatter) Formatter

NewRandomlyFormatter is a method that wraps a given Formatter, with the RandomlyFormattingFormatter that is wrapped with a PerWordFormattingFormatter

func NewSarcasticFormatter

func NewSarcasticFormatter() Formatter

NewSarcasticFormatter returns a CharFormatterDelegatingFormatter that wraps a RandomlyFormattingCharFormatter that randomly delegates to SwitchCaseCharFormatter

func NewShuffleFormatter added in v0.7.1

func NewShuffleFormatter() Formatter

NewShuffleFormatter returns a PerWordFormattingFormatter wrapping a ShuffleFormatter

func NewStudderFormatter added in v0.7.1

func NewStudderFormatter() Formatter

NewStudderFormatter returns a PerWordFormattingFormatter that wraps a StudderFormatter

func NewSwearFormatter added in v0.6.1

func NewSwearFormatter() Formatter

NewSwearFormatter reuturns a Formatter that replaces each character in a word with cartoonish swear

func NewUppercaseFormatter added in v0.7.1

func NewUppercaseFormatter() Formatter

func NewWordReversingFormatter added in v0.3.1

func NewWordReversingFormatter() Formatter

NewWordReversingFormatter returns a ReversingFormatter that reverses each words in a group, and not the entire text as one

func RandomTitleFormatter

func RandomTitleFormatter() Formatter

RandomTitleFormatter returns a formatter that titles only every other time

func Uber1337Formatter

func Uber1337Formatter() Formatter

Uber1337Formatter returns an initiated randomly chosen L337CharFormatter with the special uber1337-map

type HorseFormatter added in v0.7.1

type HorseFormatter struct {
	RandomDevice
}

HorseFormatter returns horse-related banter for each call

func (HorseFormatter) Format added in v0.7.1

func (s HorseFormatter) Format(_ string) string

Format returns a random horse-related word

type L337CharFormatter

type L337CharFormatter struct {
	// contains filtered or unexported fields
}

L337CharFormatter is a CharFormatter that formats by replacing the given rune by a slice if runes as stated in the internal map

func (L337CharFormatter) FormatRune

func (u L337CharFormatter) FormatRune(r rune) []rune

FormatRune returns the rune-slice given in the internal map, or returns the input value

type LowercaseCharFormatter

type LowercaseCharFormatter struct{}

LowercaseCharFormatter formats lowercase

func (LowercaseCharFormatter) FormatRune

func (LowercaseCharFormatter) FormatRune(r rune) []rune

FormatRune the rune, but lowercase

type MultiFormatter

type MultiFormatter struct {
	Formatters []Formatter
}

MultiFormatter is a wrapper to handle formatting with multiple Formatters

func (*MultiFormatter) Format

func (m *MultiFormatter) Format(word string) string

Format delegates/reassigns the input string sequentially for all formatters

func (*MultiFormatter) With

func (m *MultiFormatter) With(f Formatter)

With appends a given Formatter to the Formatters in MultiFormatter

type PerWordFormattingFormatter added in v0.3.1

type PerWordFormattingFormatter struct {
	Other Formatter
}

PerWordFormattingFormatter delegates to another Formatter, but calls the Format method for each word

func (*PerWordFormattingFormatter) Format added in v0.3.1

func (p *PerWordFormattingFormatter) Format(word string) string

Format splits the text on space, and calls Other > Format for each word, then joining the text again.

func (*PerWordFormattingFormatter) GetFormatter added in v0.6.1

func (p *PerWordFormattingFormatter) GetFormatter() Formatter

GetFormatter returns the wrapped formatter of PerWordFormattingFormatter

func (*PerWordFormattingFormatter) SetFormatter added in v0.6.1

func (p *PerWordFormattingFormatter) SetFormatter(formatter Formatter)

SetFormatter sets the Formatter that PerWordFormattingFormatter should wrap

type RandomDevice

type RandomDevice interface {
	// Rand is a function that returns a random number between 0 and 1
	Rand() *big.Rat
	RandMax(max int) int
}

type RandomlyFormattingCharFormatter

type RandomlyFormattingCharFormatter struct {
	Other CharFormatter
	// contains filtered or unexported fields
}

RandomlyFormattingCharFormatter is a CharFormatter that delegates randomly to the embedded CharFormatter: Other

func NewRandomFormatter

func NewRandomFormatter() *RandomlyFormattingCharFormatter

NewRandomFormatter is a Returns a RandomlyFormattingCharFormatter that delegates to another CharFormatter at a rate of 50%

func (*RandomlyFormattingCharFormatter) FormatRune

func (rff *RandomlyFormattingCharFormatter) FormatRune(r rune) []rune

FormatRune formats a single rune or not given the Random with threshold

func (*RandomlyFormattingCharFormatter) GetCharFormatter added in v0.6.1

func (rff *RandomlyFormattingCharFormatter) GetCharFormatter() CharFormatter

func (*RandomlyFormattingCharFormatter) SetCharFormatter added in v0.6.1

func (rff *RandomlyFormattingCharFormatter) SetCharFormatter(wrap CharFormatter)

type RandomlyFormattingFormatter

type RandomlyFormattingFormatter struct {
	Other Formatter
	// contains filtered or unexported fields
}

RandomlyFormattingFormatter is a formatter that formats at a rate of 50%

func (*RandomlyFormattingFormatter) Format

func (rff *RandomlyFormattingFormatter) Format(word string) string

Format calls the Other > Format at a rate of 50%

func (*RandomlyFormattingFormatter) GetFormatter added in v0.6.1

func (rff *RandomlyFormattingFormatter) GetFormatter() Formatter

GetFormatter returns the Formatter that RandomlyFormattingFormatter wraps

func (*RandomlyFormattingFormatter) SetFormatter added in v0.6.1

func (rff *RandomlyFormattingFormatter) SetFormatter(wrap Formatter)

SetFormatter sets the wrapped Formatter of RandomlyFormattingFormatter

type RegexReplacingFormatter

type RegexReplacingFormatter struct {
	// PatternMatcher is a regexp.Regexp, to match against the text
	PatternMatcher *regexp.Regexp
	// Replacement is whatever is to be replaced by the given PatternMatcher
	Replacement string
}

RegexReplacingFormatter is a Formatter that performs a regex replace functionality on the given text

func (*RegexReplacingFormatter) Format

func (rr *RegexReplacingFormatter) Format(word string) string

Format replaces all instances of the given regex PatternMatcher with the Replacement

type ReversingFormatter added in v0.3.1

type ReversingFormatter struct{}

ReversingFormatter reverses the string

func (ReversingFormatter) Format added in v0.3.1

func (ReversingFormatter) Format(text string) string

Format reverses the input text

type ShuffleFormatter added in v0.7.1

type ShuffleFormatter struct {
	RandomDevice
}

ShuffleFormatter shuffles the given string

func (ShuffleFormatter) Format added in v0.7.1

func (s ShuffleFormatter) Format(text string) string

Format shuffles the characters of an input string and returns a new shuffled string

type StudderFormatter added in v0.7.1

type StudderFormatter struct {
	RandomDevice
}

StudderFormatter is a formatter that writes text that appear like it's studdering

func (StudderFormatter) Format added in v0.7.1

func (s StudderFormatter) Format(word string) string

Format will return the first character of a word plus '-' up to 4 times, and the word

type SwitchCaseCharFormatter

type SwitchCaseCharFormatter struct{}

SwitchCaseCharFormatter switch the case

func (SwitchCaseCharFormatter) FormatRune

func (SwitchCaseCharFormatter) FormatRune(r rune) []rune

FormatRune switches case of the rune

type TitleFormatter

type TitleFormatter struct{}

TitleFormatter is a Formatter that Titles the given text

func (TitleFormatter) Format

func (TitleFormatter) Format(word string) string

Format calls strings.Title on the given text

type UnitFormatter

type UnitFormatter struct{}

UnitFormatter is a Noop Formatter and CharFormatter implementation

func (UnitFormatter) Format

func (UnitFormatter) Format(words string) string

Format returns the input

func (UnitFormatter) FormatRune

func (UnitFormatter) FormatRune(r rune) []rune

FormatRune return the rune wrapped in a slice

type UppercaseCharFormatter

type UppercaseCharFormatter struct{}

UppercaseCharFormatter formats uppercase

func (UppercaseCharFormatter) FormatRune

func (UppercaseCharFormatter) FormatRune(r rune) []rune

FormatRune uppercases the rune

type WrappingCharFormatter added in v0.6.1

type WrappingCharFormatter interface {
	CharFormatter
	SetCharFormatter(CharFormatter)
	GetCharFormatter() CharFormatter
}

WrappingCharFormatter is an interface of a CharFormatter that wraps another CharFormatter

type WrappingFormatter added in v0.6.1

type WrappingFormatter interface {
	Formatter
	SetFormatter(Formatter)
	GetFormatter() Formatter
}

WrappingFormatter is an interface of a Formatter that wraps another Formatter

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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