Documentation
¶
Overview ¶
Package kidwords provides data encoding accessible to children.
Use it to create passwords and paper keys.
## Inspired By
- [Horcrux][horcrux]
horcrux: https://github.com/jesseduffield/horcrux/tree/master
Index ¶
- Variables
- func ChecksumChop(b []byte) (remainder []byte, ok bool)
- func ChecksumWriter(w io.Writer) io.WriteCloser
- func FromBytes(b []byte, withOptions ...WriterOption) (string, error)
- func FromReader(r io.Reader, withOptions ...WriterOption) (string, error)
- func FromString(s string, withOptions ...WriterOption) (string, error)
- func ToBytes(s string, withOptions ...ReaderOption) ([]byte, error)
- func ToString(s string, withOptions ...ReaderOption) (string, error)
- func ToWriter(w io.Writer, s string, withOptions ...ReaderOption) error
- type Option
- type Reader
- type ReaderOption
- type SeparatorFunc
- type Writer
- type WriterOption
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ChecksumTable = crc32.MakeTable(crc32.Koopman)
Functions ¶
func ChecksumChop ¶
func ChecksumWriter ¶
func ChecksumWriter(w io.Writer) io.WriteCloser
func FromBytes ¶
func FromBytes(b []byte, withOptions ...WriterOption) (string, error)
FromBytes translates a set of bytes into Kid Words.
Example ¶
fmt.Println( FromBytes([]byte("marvel")), )
Output: hill golf hush itch half hero <nil>
func FromReader ¶
func FromReader(r io.Reader, withOptions ...WriterOption) (string, error)
FromReader translates io.Reader stream into Kid Words.
func FromString ¶
func FromString(s string, withOptions ...WriterOption) (string, error)
FromString translates a string into Kid Words.
func ToBytes ¶
func ToBytes(s string, withOptions ...ReaderOption) ([]byte, error)
ToBytes translates Kid Words into bytes.
Example ¶
b, err := ToBytes(" hill - golf hush itch ; half hero ") fmt.Println(string(b), err)
Output: marvel <nil>
Types ¶
type Option ¶
type Option interface { ReaderOption WriterOption }
func WithDictionary ¶
func WithDictionary(d *dictionary.Dictionary) Option
type ReaderOption ¶
type ReaderOption interface {
// contains filtered or unexported methods
}
type WriterOption ¶
type WriterOption interface {
// contains filtered or unexported methods
}
func WithSeparator ¶
func WithSeparator(f SeparatorFunc) WriterOption
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
kidwords
Module
|
|
Package dictionary defines arrays of 256 words used for KidWords encoding.
|
Package dictionary defines arrays of 256 words used for KidWords encoding. |
Package shamir implements Shamir Secret Sharing (SSS) scheme that splits a password into independent parts.
|
Package shamir implements Shamir Secret Sharing (SSS) scheme that splits a password into independent parts. |
store
module
|
|
test
Module
|
|
Package tgrid represents tables as simple ASCII art.
|
Package tgrid represents tables as simple ASCII art. |
Click to show internal directories.
Click to hide internal directories.