Update fzf location
[dotfiles] / .bash_base64
1
2 # # ruby
3 # base64_encode() { ruby -e 'require 'base64'; puts Base64.encode64(ARGF.read)'; }
4 # base64_decode() { ruby -e 'require 'base64'; puts Base64.decode64(ARGF.read)'; }
5 # # python
6 # base64_encode() { python -c 'import base64, sys; sys.stdout.write(base64.b64encode(sys.stdin.read()))'; }
7 # base64_decode() { python -c 'import base64, sys; sys.stdout.write(base64.b64decode(sys.stdin.read()))'; }
8 # # perl
9 # base64_encode() { perl -e 'use MIME::Base64; print encode_base64(<STDIN>);'; }
10 # base64_decode() { perl -e 'use MIME::Base64; print decode_base64(<STDIN>);'; }
11 # # openssl
12 # base64_encode() { openssl enc -base64; }
13 # base64_decode() { openssl enc -d -base64; }
14
15
16 # base64_php() { php -r 'echo base64_$1(stream_get_contents(STDIN));'; }
17 # base64_ruby() { ruby -e 'require 'base64'; puts Base64.${1}64(ARGF.read)'; }
18 # base64_perl() { perl -e 'use MIME::Base64; print $1_base64(<STDIN>);'; }
19 # base64_python() { python -c 'import base64, sys; sys.stdout.write(base64.b64$1(sys.stdin.read()))'; }
20 # base64_openssl() { openssl enc $([[ $1 == encode ]] || echo -d) -base64; }
21 # base64_choose() {
22 # for lang in openssl perl python ruby php; do
23 # if [[ $(type -t '$lang') == 'file' ]]; then
24 # 'base64_$lang' '$1'
25 # return
26 # fi
27 # done
28 # echo 'ERROR: No suitable language found'
29 # return 1
30 # }
31 # base64_encode() { base64_choose encode; }
32 # base64_decode() { base64_choose decode; }
33