From 3f17761c8691052a9b092fa0b02af00a0b42a43a Mon Sep 17 00:00:00 2001 From: zzz Date: Wed, 9 Sep 2026 15:00:39 -0400 Subject: [PATCH] i2psnark: Restore 2-arg getNameAndInfoHash() used by i2psnark-rpc plugin --- .../java/src/org/klomp/snark/MetaInfo.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/i2psnark/java/src/org/klomp/snark/MetaInfo.java b/apps/i2psnark/java/src/org/klomp/snark/MetaInfo.java index 42fcd5188..86f1695b7 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/MetaInfo.java +++ b/apps/i2psnark/java/src/org/klomp/snark/MetaInfo.java @@ -430,6 +430,18 @@ public class MetaInfo info_hash = calculateInfoHash(); } + /** + * Efficiently returns the name and the 20 byte SHA1 hash of the info dictionary in a torrent file. + * Caller must close stream. + * Unused within snark, used by i2psnark-rpc plugin. + * + * @param infoHashOut 20-byte out parameter + * @since 0.8.5 + */ + public static String getNameAndInfoHash(InputStream in, byte[] infoHashOut) throws IOException { + return getNameAndInfoHash(in, infoHashOut, new AtomicLong()); + } + /** * Efficiently returns the name and the 20 byte SHA1 hash of the info dictionary in a torrent file, * and approximate total length. @@ -437,7 +449,7 @@ public class MetaInfo * * @param infoHashOut 20-byte out parameter * @param lengthOut out parameter approximate, not exact - * @since 0.8.5 + * @since 0.9.71 */ public static String getNameAndInfoHash(InputStream in, byte[] infoHashOut, AtomicLong lengthOut) throws IOException { BDecoder bd = new BDecoder(in);