-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new functions b64encode
and b4decode
#50
Comments
base64encode
and base64decode
b64encode
and b4decode
Select the name for method:
|
Hi @spyzhov |
@ryzheboka, sure! Please create 2 new methods with names You can implement them in the same way as function Input and Output type should be |
Do I declare the methods using the following signatures?
where the each Node is a string Node? What do I do if the Node isn't a string? Or should I rather use the following signature?
|
The first suggestion was right, it should be something like this: "base64_encode": func(node *Node) (result *Node, err error) {
if node.IsString() {
if res, err := node.GetString(); err != nil {
return nil, err
} else {
var result string
// ... implementation
return valueNode(nil, "base64_encode", String, result), nil
}
}
return valueNode(nil, "base64_encode", Null, nil), nil
},
"base64_decode": func(node *Node) (result *Node, err error) { The current implementation of functions could have only 1 argument and it's applicable to any type of node. |
Also, please be aware that _, _ = base64.StdEncoding.WithPadding(base64.NoPadding).DecodeString(str)
_, _ = base64.StdEncoding.WithPadding(base64.StdPadding).DecodeString(str) Some strings can not be decoded with/without padding. Probably better to create 4 functions: pair of functions with and without |
There seems to be a problem with https://github.com/mattn/goveralls which leads to the pipeline failure, The pipeline cannot execute |
It's OK, when I'll press a button to run it "from my name", it will resolve this problem. |
Add new functions
b64encode
andb64decode
that are equal to the same functions fromencoding/base64
The text was updated successfully, but these errors were encountered: