Documentation
¶
Overview ¶
Package ncipher provides "Nyanpasu Cipher (N-Cipher)" encoder & decoder
Example ¶
package main import ( "fmt" "github.com/844196/ncipher" ) func main() { in := "われわれはかしこいので" out := ncipher.StdEncoding.Encode(in) fmt.Println(out) }
Output: ぱすすんゃゃ〜ぱすすんにぱ〜ぱすすんゃゃ〜ぱすすんにぱ〜ぱすすにすす〜ぱすぱすんぱ〜ぱすすににに〜ぱすぱすすゃ〜ぱすぱすゃゃ〜ぱすすにすぱ〜ぱすすにぱゃ〜
Index ¶
Examples ¶
Constants ¶
View Source
const ( SeedMin = 2 SeedMax = 36 DelimiterMin = 1 )
Variables ¶
View Source
var ( StdConfig = Config{Seed: "にゃんぱす", Delimiter: "〜"} StdEncoding, _ = NewEncoding(&StdConfig) )
Functions ¶
This section is empty.
Types ¶
type Encoding ¶
type Encoding struct {
// contains filtered or unexported fields
}
func NewEncoding ¶
func (*Encoding) Decode ¶
Example ¶
package main import ( "fmt" "github.com/844196/ncipher" ) func main() { cnf := ncipher.Config{ Seed: "あいうえおかきくけこさしすせそたちつてとなにぬねの", Delimiter: "、", } enc, _ := ncipher.NewEncoding(&cnf) in := "とにか、ないた、えね、えぬ、おそ、いく、とにし、ととな、おう、おつ、おえ、えぬ、" out, _ := enc.Decode(in) fmt.Println(out) }
Output: ふーbar ほげfuga
func (*Encoding) Encode ¶
Example ¶
package main import ( "fmt" "github.com/844196/ncipher" ) func main() { cnf := ncipher.Config{ Seed: "あいうえおかきくけこさしすせそたちつてとなにぬねの", Delimiter: "、", } enc, _ := ncipher.NewEncoding(&cnf) in := "ふーbar ほげfuga" out := enc.Encode(in) fmt.Println(out) }
Output: とにか、ないた、えね、えぬ、おそ、いく、とにし、ととな、おう、おつ、おえ、えぬ、
Click to show internal directories.
Click to hide internal directories.