forked from I2P_Developers/i2p.i2p
Consolidate base64 alphabet string
This commit is contained in:
@@ -139,7 +139,7 @@ public class SnarkManager implements CompleteListener {
|
||||
public static final int DEFAULT_TUNNEL_QUANTITY = 3;
|
||||
public static final String CONFIG_DIR_SUFFIX = ".d";
|
||||
private static final String SUBDIR_PREFIX = "s";
|
||||
private static final String B64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-~";
|
||||
private static final String B64 = Base64.ALPHABET_I2P;
|
||||
|
||||
/**
|
||||
* "name", "announceURL=websiteURL" pairs
|
||||
|
||||
@@ -66,7 +66,7 @@ class PersistentMailCache {
|
||||
private static final String FILE_PREFIX = "mail-";
|
||||
private static final String HDR_SUFFIX = ".hdr.txt.gz";
|
||||
private static final String FULL_SUFFIX = ".full.txt.gz";
|
||||
private static final String B64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-~";
|
||||
private static final String B64 = Base64.ALPHABET_I2P;
|
||||
|
||||
/**
|
||||
* Use the params to generate a unique directory name.
|
||||
|
||||
@@ -39,6 +39,7 @@ import java.util.Locale;
|
||||
*/
|
||||
public class Base64 {
|
||||
|
||||
|
||||
//private final static Log _log = new Log(Base64.class);
|
||||
|
||||
/**
|
||||
@@ -134,18 +135,14 @@ public class Base64 {
|
||||
(byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7',
|
||||
(byte) '8', (byte) '9', (byte) '+', (byte) '/'};
|
||||
|
||||
/**
|
||||
* The I2P Alphabet.
|
||||
* @since 0.9.29
|
||||
*/
|
||||
public static final String ALPHABET_I2P = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-~";
|
||||
|
||||
/** The 64 valid Base64 values for I2P. */
|
||||
private final static byte[] ALPHABET_ALT = { (byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F',
|
||||
(byte) 'G', (byte) 'H', (byte) 'I', (byte) 'J', (byte) 'K', (byte) 'L',
|
||||
(byte) 'M', (byte) 'N', (byte) 'O', (byte) 'P', (byte) 'Q', (byte) 'R',
|
||||
(byte) 'S', (byte) 'T', (byte) 'U', (byte) 'V', (byte) 'W', (byte) 'X',
|
||||
(byte) 'Y', (byte) 'Z', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd',
|
||||
(byte) 'e', (byte) 'f', (byte) 'g', (byte) 'h', (byte) 'i', (byte) 'j',
|
||||
(byte) 'k', (byte) 'l', (byte) 'm', (byte) 'n', (byte) 'o', (byte) 'p',
|
||||
(byte) 'q', (byte) 'r', (byte) 's', (byte) 't', (byte) 'u', (byte) 'v',
|
||||
(byte) 'w', (byte) 'x', (byte) 'y', (byte) 'z', (byte) '0', (byte) '1',
|
||||
(byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7',
|
||||
(byte) '8', (byte) '9', (byte) '-', (byte) '~'};
|
||||
private final static byte[] ALPHABET_ALT = DataHelper.getASCII(ALPHABET_I2P);
|
||||
|
||||
/**
|
||||
* Translates a Base64 value to either its 6-bit reconstruction value
|
||||
|
||||
@@ -59,7 +59,7 @@ public class PersistentDataStore extends TransientDataStore {
|
||||
private final static int READ_DELAY = 2*60*1000;
|
||||
private static final String PROP_FLAT = "router.networkDatabase.flat";
|
||||
static final String DIR_PREFIX = "r";
|
||||
static final String B64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-~";
|
||||
private static final String B64 = Base64.ALPHABET_I2P;
|
||||
|
||||
/**
|
||||
* @param dbDir relative path
|
||||
|
||||
@@ -45,7 +45,7 @@ class ProfilePersistenceHelper {
|
||||
private static final String UNCOMPRESSED_SUFFIX = ".txt";
|
||||
private static final String OLD_SUFFIX = ".dat";
|
||||
private static final String DIR_PREFIX = "p";
|
||||
private static final String B64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-~";
|
||||
private static final String B64 = Base64.ALPHABET_I2P;
|
||||
|
||||
/**
|
||||
* If we haven't been able to get a message through to the peer in this much time,
|
||||
|
||||
Reference in New Issue
Block a user