Data: New Hash.toBase32() method

This commit is contained in:
zzz
2016-02-13 15:35:57 +00:00
parent e65bd26ad5
commit 8ef593fe98

View File

@ -105,6 +105,17 @@ public class Hash extends SimpleDataStructure {
return _base64ed;
}
/**
* For convenience.
* @return "{52 chars}.b32.i2p" or null if data not set.
* @since 0.9.25
*/
public String toBase32() {
if (_data == null)
return null;
return Base32.encode(_data) + ".b32.i2p";
}
/**
* @since 0.9.17
*/