forked from I2P_Developers/i2p.i2p
Add Destination.toBase32()
This commit is contained in:
@@ -172,6 +172,19 @@ public class Destination extends KeysAndCert {
|
||||
return _cachedB64;
|
||||
}
|
||||
|
||||
/**
|
||||
* For convenience.
|
||||
* @return "{52 chars}.b32.i2p" or null if fields not set.
|
||||
* @since 0.9.14
|
||||
*/
|
||||
public String toBase32() {
|
||||
try {
|
||||
return Base32.encode(getHash().getData()) + ".b32.i2p";
|
||||
} catch (IllegalStateException ise) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the cache.
|
||||
* @since 0.9.9
|
||||
|
||||
@@ -427,7 +427,7 @@ public class PrivateKeyFile {
|
||||
s.append("Dest: ");
|
||||
s.append(this.dest != null ? this.dest.toBase64() : "null");
|
||||
s.append("\nB32: ");
|
||||
s.append(this.dest != null ? Base32.encode(this.dest.calculateHash().getData()) + ".b32.i2p" : "null");
|
||||
s.append(this.dest != null ? this.dest.toBase32() : "null");
|
||||
s.append("\nContains: ");
|
||||
s.append(this.dest);
|
||||
s.append("\nPrivate Key: ");
|
||||
|
||||
Reference in New Issue
Block a user