Class Base58.Builder
java.lang.Object
org.apache.commons.codec.binary.BaseNCodec.AbstractBuilder<Base58, Base58.Builder>
org.apache.commons.codec.binary.Base58.Builder
- Enclosing class:
Base58
Builds
Base58 instances with custom configuration.- Since:
- 1.22.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()Gets a new Base58 instance with the configured settings.setEncodeTable(byte... encodeTable) Sets the encode table and derives the matching decode table.setLineLength(int lineLength) Sets the line length to zero.setMaxDecodeLength(int maxDecodeLength) Sets the maximum number of encoded bytes accepted by a single decode operation.setMaxEncodeLength(int maxEncodeLength) Sets the maximum number of binary bytes accepted by a single encode operation.Methods inherited from class BaseNCodec.AbstractBuilder
setDecodeTable, setDecodingPolicy, setLineSeparator, setPadding
-
Constructor Details
-
Builder
public Builder()Constructs a new Base58 builder.
-
-
Method Details
-
get
-
setEncodeTable
Sets the encode table and derives the matching decode table.- Overrides:
setEncodeTablein classBaseNCodec.AbstractBuilder<Base58, Base58.Builder>- Parameters:
encodeTable- The encode table with exactly 58 unique entries, null resets to the default.- Returns:
thisinstance.- Throws:
IllegalArgumentException- Thrown if the encode table does not contain exactly 58 unique entries.
-
setLineLength
Sets the line length to zero.Base58 does not support line chunking. Zero or a negative value selects unchunked output.
- Overrides:
setLineLengthin classBaseNCodec.AbstractBuilder<Base58, Base58.Builder>- Parameters:
lineLength- The line length; must not be positive.- Returns:
thisinstance.- Throws:
IllegalArgumentException- Thrown if lineLength is positive.- Since:
- 1.23.0
-
setMaxDecodeLength
Sets the maximum number of encoded bytes accepted by a single decode operation.Defaults to
Base58.DEFAULT_MAX_DECODE_LENGTH. PassInteger.MAX_VALUEto effectively disable the limit for trusted input.- Parameters:
maxDecodeLength- The maximum accepted encoded input length; must be positive.- Returns:
thisinstance.- Throws:
IllegalArgumentException- Thrown if maxDecodeLength is not positive.- Since:
- 1.23.0
-
setMaxEncodeLength
Sets the maximum number of binary bytes accepted by a single encode operation.Defaults to
Base58.DEFAULT_MAX_ENCODE_LENGTH. PassInteger.MAX_VALUEto effectively disable the limit for trusted input.- Parameters:
maxEncodeLength- The maximum accepted binary input length; must be positive.- Returns:
thisinstance.- Throws:
IllegalArgumentException- Thrown if maxEncodeLength is not positive.- Since:
- 1.23.0
-