Skip to content

Encode / Decode

Base64, hex, URL, and HTML encoding and decoding.

7 modules

ModuleDescription
Base64 解碼解碼 Base64 編碼的文字
十六進位解碼解碼十六進位到文字
URL 解碼解碼 URL 編碼的文字
Base64 編碼將文字編碼成 Base64
十六進位編碼將文字編碼成十六進位
HTML 編碼將文字編碼成 HTML 實體
URL 編碼將文字進行 URL 編碼(百分比編碼)

Modules

Base64 解碼

decode.base64

解碼 Base64 編碼的文字

Parameters:

NameTypeRequiredDefaultDescription
texttextYes-要解碼的 Base64 編碼文字
encodingstringNoutf-8要解碼的 Base64 編碼文字
url_safebooleanNoFalse輸出的字元編碼

Output:

FieldTypeDescription
resultstring輸入是 URL 安全的 Base64
originalstring解碼後的字串
validboolean解碼後的字串

十六進位解碼

decode.hex

解碼十六進位到文字

Parameters:

NameTypeRequiredDefaultDescription
texttextYes-要解碼的十六進位文字
encodingstringNoutf-8要解碼的十六進位文字

Output:

FieldTypeDescription
resultstring輸出的字元編碼
originalstring解碼後的字串
validboolean解碼後的字串

URL 解碼

decode.url

解碼 URL 編碼的文字

Parameters:

NameTypeRequiredDefaultDescription
texttextYes-要解碼的 URL 編碼文字
plus_spacesbooleanNoFalse要解碼的 URL 編碼文字

Output:

FieldTypeDescription
resultstring將 + 處理為空格(表單解碼)
originalstring解碼後的字串

Base64 編碼

encode.base64

將文字編碼成 Base64

Parameters:

NameTypeRequiredDefaultDescription
texttextYes-要編碼的文字
encodingstringNoutf-8要編碼的文字
url_safebooleanNoFalse字元編碼

Output:

FieldTypeDescription
resultstring使用 URL 安全的 Base64 編碼
originalstringBase64 編碼字串
lengthnumberBase64 編碼字串

十六進位編碼

encode.hex

將文字編碼成十六進位

Parameters:

NameTypeRequiredDefaultDescription
texttextYes-要編碼成十六進位的文字
encodingstringNoutf-8要編碼成十六進位的文字
uppercasebooleanNoFalse字元編碼
separatorstringNo-使用大寫的十六進位字母

Output:

FieldTypeDescription
resultstring十六進位字節之間的分隔符
originalstring十六進位編碼字串
byte_countnumber十六進位編碼字串

HTML 編碼

encode.html

將文字編碼成 HTML 實體

Parameters:

NameTypeRequiredDefaultDescription
texttextYes-要編碼成 HTML 實體的文字
quotebooleanNoTrue要編碼成 HTML 實體的文字

Output:

FieldTypeDescription
resultstring也編碼引號字元
originalstringHTML 編碼字串

URL 編碼

encode.url

將文字進行 URL 編碼(百分比編碼)

Parameters:

NameTypeRequiredDefaultDescription
texttextYes-要進行 URL 編碼的文字
plus_spacesbooleanNoFalse要進行 URL 編碼的文字
safestringNo-使用 + 代替 %20 表示空格(表單編碼)

Output:

FieldTypeDescription
resultstring不應編碼的字元
originalstringURL 編碼字串

Released under the Apache 2.0 License.