Skip to content

Commit

Permalink
Util: Add .i2p.alt support to ConvertToHash
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzi2p committed Jan 30, 2024
1 parent 081a024 commit c6e6e79
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/java/src/net/i2p/util/ConvertToHash.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public static Hash getHash(String peer) {
if (peer == null)
return null;
String peerLC = peer.toLowerCase(Locale.US);
if (peerLC.endsWith(".i2p.alt")) {
peer = peer.substring(0, peer.length() - 4);
peerLC = peerLC.substring(0, peer.length() - 4);
}
// b64 hash
if (peer.length() == 44 && !peerLC.endsWith(".i2p")) {
byte[] b = Base64.decode(peer);
Expand Down

0 comments on commit c6e6e79

Please sign in to comment.