Scroll to navigation

BASENC(1) 使用者命令 BASENC(1)

名稱

basenc - 編碼/解碼資料並輸出至標準輸出

概述

basenc [選項]... [檔案]

描述

basenc 可以編碼/解碼檔案或標準輸入輸出。

如果沒有指定檔案,或者指定檔案為“-”,則從標準輸入讀取。

必選引數對長短選項同時適用。

與 'base64' 程式相同(RFC4648 section 4)
檔案安全和 url 安全的 base64(RFC4648 section 5)
與 'base32' 程式相同(RFC4648 section 6)
擴充套件的十六進位制(hex)字母表 base32(RFC4648 section 7)
十六進位制(hex)編碼(RFC4648 section 8)
位字串,最高位(msb)最先
位字串,最低位(lsb)最先
解碼資料
解碼時忽略非字母字元
在指定的字元數後自動換行(預設為76),0 為禁用自動換行
類似 ascii85 的編碼(ZeroMQ 標準:32/Z85);編碼時,輸入長度必須是 4 的倍數;解碼時,輸入長度必須是 5 的倍數;
顯示此幫助資訊並退出
顯示版本資訊並退出

解碼時,輸入資料(編碼流)可能包含一些換行符,以及不在有效字元範圍之內的字元。可以嘗試用 --ignore-garbage 選項來繞過編碼流中的無效字元。

編碼示例

$ printf '\376\117\202' | basenc --base64
/k+C
$ printf '\376\117\202' | basenc --base64
/k+C
$ printf '\376\117\202' | basenc --base32
7ZHYE===
$ printf '\376\117\202' | basenc --base32hex
VP7O4===
$ printf '\376\117\202' | basenc --base16
FE4F82
$ printf '\376\117\202' | basenc --base2lsbf
011111111111001001000001
$ printf '\376\117\202' | basenc --base2msbf
111111100100111110000010
$ printf '\376\117\202\000' | basenc --z85
@.FaC

作者

由 Simon Josefsson 和 Assaf Gordon 編寫。

報告錯誤

GNU coreutils 的線上幫助: <https://www.gnu.org/software/coreutils/>
請向 <https://translationproject.org/team/zh_CN.html> 報告翻譯錯誤。

版權

Copyright © 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

參見

完整文件請見: <https://www.gnu.org/software/coreutils/basenc>
或者在本地使用: info '(coreutils) basenc invocation'

本頁面中文版由中文 man 手冊頁計劃提供。
中文 man 手冊頁計劃:https://github.com/man-pages-zh/manpages-zh

2022年9月 GNU coreutils 9.1