Package org.miaixz.bus.core.codec.binary
Class Base32
java.lang.Object
org.miaixz.bus.core.codec.binary.Base32
Base32 - encodes and decodes RFC4648 Base32 (see https://datatracker.ietf.org/doc/html/rfc4648#section-6
) base32就是用32(2的5次方)个特定ASCII码来表示256个ASCII码。 所以,5个ASCII字符经过base32编码后会变为8个字符(公约数为40),长度增加3/5.不足8n用“=”补足。 根据RFC4648
Base32规范,支持两种模式:
- Base 32 Alphabet (ABCDEFGHIJKLMNOPQRSTUVWXYZ234567)
- "Extended Hex" Base 32 Alphabet (0123456789ABCDEFGHIJKLMNOPQRSTUV)
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]解码static byte[]解码static StringdecodeStrHex(String source) base32解码static StringdecodeStrHex(String source, Charset charset) base32解码static StringdecodeString(String source) base32解码static StringdecodeString(String source, Charset charset) base32解码static Stringencode(byte[] bytes) 编码static Stringbase32编码static Stringbase32编码static StringencodeHex(byte[] bytes) 编码static Stringbase32编码(Hex模式)static Stringbase32编码(Hex模式)
-
Constructor Details
-
Base32
public Base32()
-
-
Method Details
-
encode
-
encode
-
encode
-
encodeHex
-
encodeHex
-
encodeHex
-
decode
-
decodeString
-
decodeString
-
decodeHex
-
decodeStrHex
-
decodeStrHex
-