Documentation
¶
Overview ¶
From https://github.com/gojp/kana Copyright 2013 Herman Schaaf and Shawn Smith
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright 2013 Herman Schaaf and Shawn Smith ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
From https://github.com/gojp/kana Copyright 2013 Herman Schaaf and Shawn Smith
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
From https://github.com/gojp/kana Copyright 2013 Herman Schaaf and Shawn Smith
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Variables
- func Generate(in GenerateInput) (*GenerateOutput, *State, error)
- func InitRomaji()
- func KanaToRomaji(kana string) (romaji string)
- func NewRandSource() *math_rand.Rand
- type ArgsParser
- type CryptoRandSource
- type Error
- type ErrorType
- type GenerateInput
- type GenerateOutput
- type JustifyArgs
- type LexType
- type RootGenerator
- type SharedState
- type State
- type Trie
Constants ¶
This section is empty.
Variables ¶
var HiraganaTable = `` /* 708-byte string literal not displayed */
HiraganaTable maps romaji to hiragana
var KatakanaTable = `` /* 758-byte string literal not displayed */
KatakanaTable maps romaji to katakana
Functions ¶
func Generate ¶
func Generate(in GenerateInput) (*GenerateOutput, *State, error)
Generate generates random password based on given pattern see README.md for examples of pattern
func InitRomaji ¶
func InitRomaji()
Initialize builds the Hiragana + Katakana trie. Because there is no overlap between the hiragana and katakana sets, they both use the same trie without conflict. Nice bonus!
func KanaToRomaji ¶
KanaToRomaji converts a kana string to its romaji form
func NewRandSource ¶
NewRandSource creates a new source for math/rand that uses more secure crypto/rand
Types ¶
type ArgsParser ¶
type ArgsParser struct {
// contains filtered or unexported fields
}
type CryptoRandSource ¶
type CryptoRandSource struct{}
CryptoRandSource is a source for math/rand that uses more secure crypto/rand
func (CryptoRandSource) Uint64 ¶
func (CryptoRandSource) Uint64() uint64
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is lexical error struct
func ParseSpacedError ¶
func (*Error) PrependMsg ¶
PrependMsg add a message to the end of current messages
func (*Error) SpacedError ¶
func (*Error) WithMarkLen ¶
type GenerateInput ¶
type GenerateInput struct {
Pattern []rune
}
GenerateInput is struct given to Generate
type GenerateOutput ¶
GenerateOutput is struct returned by Generate
type JustifyArgs ¶
type JustifyArgs struct {
// contains filtered or unexported fields
}
type RootGenerator ¶
type RootGenerator struct {
// contains filtered or unexported fields
}
RootGenerator is the root Generator implementation
func NewRootGenerator ¶
func NewRootGenerator() *RootGenerator
NewRootGenerator creates a new RootGenerator
func (*RootGenerator) Entropy ¶
func (g *RootGenerator) Entropy(s *State) (float64, error)
Entropy returns the entropy after .Generate() is called
func (*RootGenerator) Generate ¶
func (g *RootGenerator) Generate(s *State) error
Generate generates a password
type SharedState ¶
type SharedState struct {
// contains filtered or unexported fields
}
SharedState is the shared part of State
func NewSharedState ¶
func NewSharedState() *SharedState
NewSharedState is factory function for SharedState
func (*SharedState) Copy ¶
func (ss *SharedState) Copy() *SharedState
Source Files
¶
- alter.go
- args.go
- bip39.go
- byte_gen.go
- charclass.go
- charclass_names.go
- date.go
- error.go
- error_consts.go
- function_util.go
- functions.go
- generate.go
- group.go
- init.go
- interfaces.go
- jp_hiragana.go
- jp_katakana.go
- jp_romaji.go
- justify.go
- lex.go
- lex_charclass.go
- lex_function.go
- lex_group.go
- lex_repeat.go
- once_or_none.go
- random.go
- repeat.go
- rootgen.go
- shuffle.go
- state.go
- static.go
- strings.go
- trie.go
- utils.go