2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Mac】コマンドでBase64エンコード・デコードする方法

Posted at

エンコード

base64コマンドを使用することでエンコードできます。

$ echo "sample" | base64
c2FtcGxlCg==
base64 -i image.jpg -o output.txt

デコード

デコードするには-dを使用します。

$ echo "c2FtcGxlCg==" | base64 -d
sample
base64 -d -i sample.txt -o image.jpg 

オプション

$ base64 --help
Usage:	base64 [-Ddh] [-b num] [-i in_file] [-o out_file]
  -b, --break       break encoded output up into lines of length num
  -D, -d, --decode  decode input
  -h, --help        display this message
  -i, --input       input file (default: "-" for stdin)
  -o, --output      output file (default: "-" for stdout)
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?