Created
May 3, 2022 07:59
-
-
Save transacid/59909bf9a6b34392cc0c618bd03fdef1 to your computer and use it in GitHub Desktop.
base64 without echo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"encoding/base64" | |
"fmt" | |
"os" | |
"strings" | |
) | |
func main() { | |
var i string | |
if len(os.Args) > 1 { | |
i = os.Args[1] | |
} else { | |
r := bufio.NewReader(os.Stdin) | |
i, _ = r.ReadString('\n') | |
} | |
s := strings.TrimRight(i, "\n") | |
o, _ := base64.StdEncoding.DecodeString(s) | |
fmt.Printf("\n%s\n", string(o)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment