From 8ef593fe98b93d9239522e6620bf400262ef138d Mon Sep 17 00:00:00 2001 From: zzz Date: Sat, 13 Feb 2016 15:35:57 +0000 Subject: [PATCH] Data: New Hash.toBase32() method --- core/java/src/net/i2p/data/Hash.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/java/src/net/i2p/data/Hash.java b/core/java/src/net/i2p/data/Hash.java index 555b00e22..3de44edfe 100644 --- a/core/java/src/net/i2p/data/Hash.java +++ b/core/java/src/net/i2p/data/Hash.java @@ -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 */