mask

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package mask handles the transformation of a string into a masks

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoundarySplitPopMap

func BoundarySplitPopMap(input map[string]int, replacementMask string, bypass bool, debug bool) map[string]int

BoundarySplitPopMap splits the index of the input map into tokens based on the provided mask string provided and returns a new map with the tokens as keys and the values as the values

Args:

input (map[string]int): Input map
replacementMask (string): Mask characters to apply
bypass (bool): If true, the map is not used for output or filtering
debug (bool): If true, print additional debug information to stderr

Returns:

(map[string]int): Boundary split map

func ConstructReplacements

func ConstructReplacements(str string) []string

ConstructReplacements create an array mapping which characters to replace

This function accepts the characters "ulds" in order to generate a map - u for uppercase characters - l for lowercase characters - d for numerical characters - s for special characters

Args:

str (string): Input string

Returns:

args ([]string): Map of replacement characters

func ConvertMultiByteMask

func ConvertMultiByteMask(str string) string

ConvertMultiByteMask converts non-ascii characters to a valid format

Args:

str (string): Input string

Returns:

returnStr (string): Converted string

func MakeMaskedMap

func MakeMaskedMap(input map[string]int, replacementMask string, verbose bool, bypass bool, debug bool) map[string]int

MakeMaskedMap replaces all characters in the input maps key with the values in the input map

Args:

input (map[string]int): Map to mask
replacements ([]string): Array of characters to replace
verbose (bool): Verbose information if true
bypass (bool): If true, the map is not used for output or filtering
debug (bool): If true, print additional debug information to stderr

Returns:

maskedMap (map[string]int): Masked map

func MakeMaskedString

func MakeMaskedString(input string, replacementMask string) string

MakeMaskedString replaces all characters in the input string with the mask values in the mask string

Args:

input (string): Input string
replacementMask (string): Mask characters to apply

Returns:

(string): Masked string

func MakeMatchedMaskedMap

func MakeMatchedMaskedMap(input map[string]int, replacementMask string, maskMap map[string]int, bypass bool, debug bool) map[string]int

MakeMatchedMaskedMap returns a map from the input map where the keys matched the keys in the mask map after applying the mask to the input map. The original keys and values are retained.

Args:

input (map[string]int): Input map
replacementMask (string): Mask characters to apply
maskMap (map[string]int): Mask map
bypass (bool): If true, the map is not used for output or filtering
debug (bool): If true, print additional debug information to stderr

Returns: (map[string]int): Matched masked map

func MakeRetainMaskedMap

func MakeRetainMaskedMap(input map[string]int, replacementMask string, retain map[string]int, bypass bool, debug bool) map[string]int

MakeRetainMaskedMap replaces all characters in the input maps key with mask values in the input map but retains keywords provided in the retain list

Args:

input (map[string]int): Map to mask
replacementMask (string): Mask characters to apply
retain (map[string]int): Map of keywords to retain
bypass (bool): If true, the map is not used for output or filtering
debug (bool): If true, print additional debug information to stderr

Returns:

maskedMap (map[string]int): Masked retain map

func RemoveMaskedCharacters

func RemoveMaskedCharacters(input map[string]int, bypass bool, debug bool) map[string]int

RemoveMaskedCharacters removes masked characters from the input map and returns a new map

Args:

input (map[string]int): Input map
bypass (bool): If true, the map is not used for output or filtering
debug (bool): If true, print additional debug information to stderr

Returns:

(map[string]int): Masked map

func ShuffleMap

func ShuffleMap(input map[string]int, replacementMask string, swapMap map[string]int, bypass bool, debug bool) map[string]int

ShuffleMap shuffles the input map keys and replaces partially the masked parts of the keys with matching mask keys from the input map. This function resembles 'token-swapping' where the mask value is used to swap key words into another.

Args:

input (map[string]int): Input map
replacementMask (string): Mask characters to apply
swapMap (map[string]int): Items to swap with
bypass (bool): If true, the map is not used for output or filtering
debug (bool): If true, print additional debug information to stderr

Returns: (map[string]int): Shuffled map with swapped keys

func TestMaskComplexity

func TestMaskComplexity(str string) int

TestMaskComplexity tests the complexity of an input mask

Args:

str (string): Input string to test

Returns:

(int): Complexity score as an integer

Types

This section is empty.

Jump to

Keyboard shortcuts

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