common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EncodeRaw    = "raw"
	EncodeAbcAlt = "abcAlt"
	EncodeABC    = "ABC"
	EncodeHex    = "hex"
	EncodeBase32 = "base32"
	EncodeBase64 = "base64"
	EncodeBase85 = "base85"
)

Variables

This section is empty.

Functions

func A85DecodeString

func A85DecodeString(src string) ([]byte, error)

Ascii85 is still in development!

func A85EncodeToString

func A85EncodeToString(src []byte) string

Ascii85 is still in development!

func Chunk added in v0.1.0

func Chunk(s string, chunkSize int) []string

func DecodeShards

func DecodeShards(shardWords []string, settings FormatSettings) ([][]byte, error)

func FormatShards

func FormatShards(shards [][]byte, settings FormatSettings) []string

func LogIfFatal

func LogIfFatal(err error)

func ReadPassword

func ReadPassword() (string, error)

Read password from the terminal. Prompts user 2x for consistency.

func StripSep added in v0.1.0

func StripSep(s string, sep string) string

Remove the field separators from the shard

Types

type EncodingType

type EncodingType string

type FormatSettings

type FormatSettings struct {
	EncodingType string // binary-to-string encoding, e.g. hex, base32
	Sep          string // separator between bytes
	RecordSep    string // separator between records/shards
	FieldSize    int    // size of each field, eg 2-> DE:AD:BE:EF
	FilenamePat  string // pattern (in typical sprintf notation) for filenames
}

func ParseFormatSettings

func ParseFormatSettings(cmd *cobra.Command) (settings FormatSettings, err error)

type SplitSettings

type SplitSettings struct {
	Parts     int // total number of shards to split into
	Threshold int // number of shards required to reconstruct
}

type StdInContainer

type StdInContainer struct {
	Stdin     string
	Has_stdin bool
}

func Get_stdin

func Get_stdin() (StdInContainer, error)

Directories

Path Synopsis
ABC base-16 encoding It's just hex encoding but with all alphabetic, no numerals Advantage is being able to do things like book steganography easily (numbers are much less frequent)
ABC base-16 encoding It's just hex encoding but with all alphabetic, no numerals Advantage is being able to do things like book steganography easily (numbers are much less frequent)

Jump to

Keyboard shortcuts

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