Atitit common codec algo 常见编码算法 目录 1. 分类 1 2. BinaryEncoders 2 2.1. Base64 bin2hex etc 2 2.2. bin2h

Atitit common codec algo 常见编码算法

目录

1. 分类 1

2. BinaryEncoders 2

2.1. Base64 bin2hex etc 2

2.2. bin2hex() ,Quoted-printable ,UUencode 2

3. DigestEncoders 2

3.1. Md5 des aes etc 2

4. LanguageEncoders 2

5. NetworkEncoders 3

5.1. Urlencode 3

5.2. Rfc1522code 3

6. Doc encode 3

6.1. Htmlencode 3

6.2. Xml encode 3

6.3. Db Dirver str encode 3

7. Pic encode 4

7.1. Qrcode dmcode 4

7.2. Barcode 4

7.3. Jpg gif png etc 4

7.4. Phash pca etc 4

8. Other 4

8.1. Filename encode 4

8.2. Path encode 4

8.3. Video encode 4

8.4. Audio encode  mid 4

8.5. Json yaml toml TLV(三元组编码) csv excel 4

9. Ref 4

9.1. commons-codecApache 4

9.2. Apache common lang3 5

9.3. Atitit 算法之道 编码算法 urlencode 6

9.4. 数据交换格式 6

9.5. * 集成Commons-Codec,Commons-Lang及JDK提供的编解码方法. 6

1. 分类

2. BinaryEncoders

2.1. Base64 bin2hex etc

2.2.  bin2hex() ,Quoted-printable ,UUencode

3. DigestEncoders  

3.1. Md5 des aes etc

 

4. LanguageEncoders

5. NetworkEncoders

5.1. Urlencode

5.2. Rfc1522code

6. Doc encode

6.1. Htmlencode

6.2. Xml encode

6.3. Db Dirver str encode

7. Pic encode

7.1. Qrcode dmcode

7.2. Barcode

7.3. Jpg gif png etc

7.4. Phash pca etc

8. Other 

8.1. Filename encode

8.2. Path encode

8.3. Video encode

8.4. Audio encode  mid

8.5. Json yaml toml TLV(三元组编码) csv excel

9. Ref

9.1. commons-codecApache

commons-codecApache开源组织提供的用于摘要运算、编码的包。在该包中主要分为四类加密:

Apache BinaryEncoders、DigestEncoders、LanguageEncoders、NetworkEncoders。

Htmlencode

9.2. Apache common lang3

 * Html 转码.

 */

public static String htmlEscape(String html) {

return StringEscapeUtils.escapeHtml4(html);

}

/**

 * Html 解码.

 */

public static String htmlUnescape(String htmlEscaped) {

return StringEscapeUtils.unescapeHtml4(htmlEscaped);

}

/**

 * Xml 转码.

 */

public static String xmlEscape(String xml) {

return StringEscapeUtils.escapeXml(xml);

}

/**

 * Xml 解码.

 */

public static String xmlUnescape(String xmlEscaped) {

return StringEscapeUtils.unescapeXml(xmlEscaped);

}

 

/**

 * Hex编码.

 */

public static String hexEncode(byte[] input) {

return Hex.encodeHexString(input);

}

/**

 * Hex解码.

 */

public static byte[] hexDecode(String input) {

try {

return Hex.decodeHex(input.toCharArray());

} catch (DecoderException e) {

throw new IllegalStateException("Hex Decoder exception", e);

}

}

 

Ref

9.3. Atitit 算法之道 编码算法 urlencode

9.4. 数据交换格式

 * 各种格式的编码加码工具类.

 *

9.5.  * 集成Commons-Codec,Commons-LangJDK提供的编解码方法.

原文地址:https://www.cnblogs.com/attilax/p/15197588.html