util

package
v0.0.0-...-fbc4d25 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UPPER = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	LOWER = "abcdefghijklmnopqrstuvwxyz"
)

Variables

This section is empty.

Functions

func GeneralOptionsCompleter

func GeneralOptionsCompleter(d prompt.Document) []prompt.Suggest

func GeneralOptionsMenu

func GeneralOptionsMenu(p *Parameters)

func GetCharScore

func GetCharScore(data string) int

GetCharScore function to determine "score" of individual characters in potentially decoded message

func GetLetterPositionLower

func GetLetterPositionLower(data rune) int

GetLetterPositionLower function determines a given rune's numeric position in the alphabet, lower case version

func GetLetterPositionUpper

func GetLetterPositionUpper(data rune) int

GetLetterPositionUpper determines a given rune's numeric position in the alphabet, upper case version

func Hamming

func Hamming(data1, data2 string) int

Hamming function to calculate Hamming distance between two strings

func MainMenu(p *Parameters)
func MainMenuCompleter(d prompt.Document) []prompt.Suggest

func SetLetterByPositionLower

func SetLetterByPositionLower(data int) rune

SetLetterByPositionLower function returns the letter represented by a numeric position in the alphabet, lower case version

func SetLetterByPositionUpper

func SetLetterByPositionUpper(data int) rune

SetLetterByPositionLower function returns the letter represented by a numeric position in the alphabet, upper case version

func TotalScore

func TotalScore(data string) int

TotalScore function determines total "score" of given string

Types

type Parameters

type Parameters struct {
	Cipher     string
	Ciphertext []byte
	File       string
	Output     string
}

Parameters type to store/parse parameters used

func (Parameters) String

func (p Parameters) String() string

type ResultsStringSlice

type ResultsStringSlice []string

ResultsStringSlice type used to simplify information output via STDOUT or specified file

func (ResultsStringSlice) WriteOutput

func (r ResultsStringSlice) WriteOutput(outputFile string)

WriteOutput function for the ResultsStringSlice type to simplify information output

Jump to

Keyboard shortcuts

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