Instances
Default configured Hashids
instances can be created by using the Hashids.Builder
default instance
Hashids hashids = new Hashids.Builder().build();
or the default constructor
Hashids hashids = new Hashids();
Configuration
The Hashids.Builder
instance provides methods to configure the algorithm features like the entropy salt, the minimum hash length and the customizable alphabet.
Default Values
Below are the default values of the instance configurations which can also be found in the JavaDoc.
Hashids.Builder#salt(String)
- By default the value of the salt is empty which will generate hashes without entropyHashids.Builder#minLength(int)
By default the minimum hash length is0
which will generate hashes with the required length only depending on the given number(s)Hashids.Builder#alphabet(String)
- The default alphabet isabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
which is defined in theHashids#DEFAULT_ALPHABET
constant
Features
IceCore Hashids includes opt-in instance features to enable language specific advantages like
- exception handling
- disabling algorithm reference implementation interoperability limitations like the maximum number size
- allowing to prefix hexadecimal numbers with
0x
or0X
All public API instance features are represented by the HashidsFeature
class located in the com.arcticicestudio.icecore.hashids
package.