add b64 hash

This commit is contained in:
zzz
2012-02-19 20:57:44 +00:00
parent 3fbd8b8d14
commit 13731e7b35
2 changed files with 12 additions and 0 deletions

View File

@@ -170,6 +170,15 @@ public class AddressBean
return Base32.encode(hash) + ".b32.i2p";
}
/** @since 0.9 */
public String getB64()
{
byte[] dest = Base64.decode(destination);
if (dest == null)
return "";
return I2PAppContext.getGlobalContext().sha().calculateHash(dest).toBase64();
}
/** @since 0.8.7 */
public void setProperties(Properties p) {
props = p;

View File

@@ -94,6 +94,9 @@
<td><%=intl._("Base 32 Address")%></td>
<td><a href="http://<%=b32%>/"><%=b32%></a></td>
</tr><tr class="list${book.trClass}">
<td><%=intl._("Base 64 Hash")%></td>
<td><%=addr.getB64()%></td>
</tr><tr class="list${book.trClass}">
<td><%=intl._("Address Helper")%></td>
<td><a href="http://<%=addr.getName()%>/?i2paddresshelper=<%=addr.getDestination()%>"><%=intl._("link")%></a></td>
</tr><tr class="list${book.trClass}">