my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
963 B

3 years ago
  1. # encode64
  2. Alias plugin for encoding or decoding using `base64` command.
  3. To use it, add `encode64` to the plugins array in your zshrc file:
  4. ```zsh
  5. plugins=(... encode64)
  6. ```
  7. ## Functions and Aliases
  8. | Function | Alias | Description |
  9. | ---------- | ----- | ------------------------------ |
  10. | `encode64` | `e64` | Encodes given data to base64 |
  11. | `decode64` | `d64` | Decodes given data from base64 |
  12. ## Usage and examples
  13. ### Encoding
  14. - From parameter
  15. ```console
  16. $ encode64 "oh-my-zsh"
  17. b2gtbXktenNo
  18. $ e64 "oh-my-zsh"
  19. b2gtbXktenNo
  20. ```
  21. - From piping
  22. ```console
  23. $ echo "oh-my-zsh" | encode64
  24. b2gtbXktenNo==
  25. $ echo "oh-my-zsh" | e64
  26. b2gtbXktenNo==
  27. ```
  28. ### Decoding
  29. - From parameter
  30. ```console
  31. $ decode64 b2gtbXktenNo
  32. oh-my-zsh%
  33. $ d64 b2gtbXktenNo
  34. oh-my-zsh%
  35. ```
  36. - From piping
  37. ```console
  38. $ echo "b2gtbXktenNoCg==" | decode64
  39. oh-my-zsh
  40. $ echo "b2gtbXktenNoCg==" | d64
  41. oh-my-zsh
  42. ```