• base64编解码


    Base64编解码(C++版)

    http://www.cnblogs.com/phinecos/archive/2008/10/10/1308272.html

    Base64 编解码C语言实现

    http://www.cnblogs.com/syxchina/archive/2010/07/25/2197388.html

     

     

     

    http://codingstandards.iteye.com/blog/934928

     

    常用方式

    格式:base64

    从标准输入中读取数据,按Ctrl+D结束输入。将输入的内容编码为base64字符串输出。

    格式:echo "str" | base64

    将字符串str+换行 编码为base64字符串输出。

    格式:echo -n "str" | base64

    将字符串str编码为base64字符串输出。注意与上面的差别。(2011.08.01 补充)

    格式:base64 file

    从指定的文件file中读取数据,编码为base64字符串输出。

    格式:base64 -d

    从标准输入中读取已经进行base64编码的内容,解码输出。

    格式:base64 -d -i

    从标准输入中读取已经进行base64编码的内容,解码输出。加上-i参数,忽略非字母表字符,比如换行符。

    man base64 写道
    -i, --ignore-garbage
    When decoding, ignore non-alphabet characters.

    use --ignore-garbage to attempt to recover from non-alphabet characters (such as newlines) in the encoded stream.

     

    格式:echo "str" | base64 -d

    将base64编码的字符串str+换行 解码输出。

    格式:echo -n "str" | base64 -d

    将base64编码的字符串str解码输出。 注意与上面的差别。(2011.08.01 补充)

    格式:base64 -d file

    从指定的文件file中读取base64编码的内容,解码输出。

    使用示例

    示例一

    [root@web ~]# base64
    hello
    Ctrl+D aGVsbG8K
    [root@web ~]#

    [root@web ~]#
    [root@web ~]# base64 -d
    aGVsbG8K
    Ctrl+D hello
    base64: invalid input
    [root@web ~]#

    你会发现,base64命令会输出 base64: invalid input,似乎它把按Ctrl+D后的空行也作为输入来处理了。

  • 相关阅读:
    java枚举enum
    冒泡排序、选择排序、插入排序、二分法排序、快速排序、二叉树排序、堆排序总结
    Django-tinymce富文本的使用
    Redis-基本操作总结
    git-总结大全
    css-总结
    html-table布局
    html表单示例
    html总结
    python-浅拷贝、深拷贝实例以及讲解
  • 原文地址:https://www.cnblogs.com/jingzhishen/p/3622418.html
Copyright © 2020-2023  润新知