Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode outputs raw data from base64 encoding string.
Example ¶
package main
import (
"bytes"
"fmt"
"strings"
"github.com/goark/gnkf/b64"
)
func main() {
input := strings.NewReader("SGVsbG8gV29ybGQK")
output := &bytes.Buffer{}
if err := b64.Decode(false, false, input, output); err != nil {
fmt.Println(err)
return
}
fmt.Print(output.String())
}
Output: Hello World
func Encode ¶
Encode outputs base64 encoding string from raw data.
Example ¶
package main
import (
"bytes"
"fmt"
"strings"
"github.com/goark/gnkf/b64"
)
func main() {
input := strings.NewReader("Hello World\n")
output := &bytes.Buffer{}
if err := b64.Encode(false, false, input, output); err != nil {
fmt.Println(err)
return
}
fmt.Println(output.String())
}
Output: SGVsbG8gV29ybGQK
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.