add converttohash to commandline

This commit is contained in:
zzz
2016-11-25 14:06:23 +00:00
parent e3435dce10
commit ffb3a75813
2 changed files with 15 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ public class CommandLine {
"net.i2p.data.Base64",
"net.i2p.data.PrivateKeyFile",
"net.i2p.util.Addresses",
"net.i2p.util.ConvertToHash",
"net.i2p.util.EepGet",
"net.i2p.util.EepHead",
"net.i2p.util.FileUtil",

View File

@@ -82,4 +82,18 @@ public class ConvertToHash {
return null;
}
/**
* @since 0.9.28
*/
public static void main(String args[]) {
if (args.length == 0) {
System.err.println("Usage: converttohash [hostname|b32|destination]...");
return;
}
for (int i = 0; i < args.length; i++) {
Hash h = getHash(args[i]);
System.out.println(h != null ? h.toBase64() : "conversion failed");
}
}
}