passman-core-0.3.1: Deterministic password generator

CopyrightMatthew Harm Bekkema 2016
LicenseGPL-2
Maintainermbekkema97@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Passman.Core.Mode

Contents

Description

 

Synopsis

Mode

data Mode Source

Represents the sets of characters that generated passwords may contain.

Base modes

modeS :: Mode Source

Represents the character set: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

modeN :: Mode Source

Represents the character set: 0123456789

modeC :: Mode Source

Represents the character set: ABCDEFGHIJKLMNOPQRSTUVWXYZ

modeL :: Mode Source

Represents the character set: abcdefghijklmnopqrstuvwxyz

Constants

validModes :: [Mode] Source

List of every valid mode

defaultMode :: Mode Source

The combination of modeN, modeC and modeL

Combining modes

(<+>) :: Mode -> Mode -> Mode Source

Join two modes together. For example modeC <+> modeL represents the character set: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz

combineModes :: [Mode] -> Maybe Mode Source

Combines a list of modes using <+>. Returns Nothing on empty list.

Splitting modes

(<->) :: Mode -> Mode -> Maybe Mode Source

Subtracts a mode from another mode. Returns Nothing if the result would be empty

splitMode :: Mode -> [Mode] Source

Split a mode into its base modes.

Parsing modes

readModeMay :: String -> Maybe Mode Source

Reads a string for the characters: s, n, c or l. Constructs a mode based on those characters where s represents modeS, n represents modeN, c represents modeC and l represents modeL. Returns Nothing if the string does not contain s, n, c or l.

readModeDef :: String -> Mode Source

Like readModeMay, but returns defaultMode instead of Nothing.

Convert mode to character set

modeToConstraint :: Mode -> String Source

Get the character set that the specified mode represents