public class HashID extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
MAX_NUMBER
Max number that can be encoded with Hashids.
|
| Constructor and Description |
|---|
HashID() |
HashID(String salt) |
HashID(String salt,
int minHashLength) |
HashID(String salt,
int minHashLength,
String alphabet) |
| Modifier and Type | Method and Description |
|---|---|
static int |
checkedCast(long value) |
long[] |
decode(String hash)
Decrypt string to numbers
|
String |
decodeHex(String hash)
Decrypt string to numbers
|
String |
encode(long... numbers)
Encrypt numbers to string
|
String |
encodeHex(String hexa)
Encrypt hexa to string
|
String |
getSalt() |
String |
getVersion()
Get Hashid algorithm version.
|
static void |
main(String[] args) |
public static final long MAX_NUMBER
public HashID()
public HashID(String salt)
public HashID(String salt, int minHashLength)
public static int checkedCast(long value)
public static void main(String[] args)
public String encode(long... numbers)
numbers - the numbers to encryptpublic long[] decode(String hash)
hash - the encrypt stringpublic String encodeHex(String hexa)
hexa - the hexa to encryptpublic String decodeHex(String hash)
hash - the encrypt stringpublic String getVersion()
public String getSalt()
Copyright © 2019. All rights reserved.