Hacker News new | ask | show | jobs
by fru2013 2730 days ago
Cross platform

  echo Z3JlZ0Bhc3NldG1hcHBpbmcuY29tCg== | perl -MMIME::Base64 -pe 's/(.+)/decode_base64($1)/e'
1 comments

Thank you :-) We are (mostly) python house on the back-end so I might use python instead of perl but I like the approach you suggested.
Well, since you mentioned Docker:

    echo Z3JlZ0Bhc3NldG1hcHBpbmcuY29tCg== | docker run -i busybox base64 -d
Edit: Yes, I'm piping your email address through an operating system image I just downloaded from the internet and, to be honest, I feel quite badly about this. :(

  >>> import base64

  >>> email = "Z3JlZ0Bhc3NldG1hcHBpbmcuY29tCg=="

  >>> print(base64.b64decode(email).decode('utf-8'))