Package org.xbill.DNS.utils
Class base32
java.lang.Object
org.xbill.DNS.utils.base32
Routines for converting between Strings of base32-encoded data and arrays of binary data. This
currently supports the base32 and base32hex alphabets specified in RFC 4648, sections 6 and 7.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intblockLenToPadding(int blocklen) byte[]fromString(String str) Convert a base32-encoded String to binary dataprivate static intpaddingToBlockLen(int padlen) toString(byte[] b) Convert binary data to a base32-encoded String
-
Field Details
-
alphabet
-
padding
private final boolean padding -
lowercase
private final boolean lowercase
-
-
Constructor Details
-
base32
Creates an object that can be used to do base32 conversions.- Parameters:
alphabet- Which alphabet should be usedpadding- Whether padding should be usedlowercase- Whether lowercase characters should be used. default parameters (The standard base32 alphabet, no padding, uppercase)
-
-
Method Details
-
blockLenToPadding
private static int blockLenToPadding(int blocklen) -
paddingToBlockLen
private static int paddingToBlockLen(int padlen) -
toString
Convert binary data to a base32-encoded String- Parameters:
b- An array containing binary data- Returns:
- A String containing the encoded data
-
fromString
Convert a base32-encoded String to binary data- Parameters:
str- A String containing the encoded data- Returns:
- An array containing the binary data, or null if the string is invalid
-