Remove ED2K support

This commit is contained in:
Reinhard Pointner 2019-02-20 02:21:08 +07:00
parent 3f3643ad71
commit b01e0f3dc8
4 changed files with 2 additions and 59 deletions

View File

@ -56,5 +56,4 @@ ivy/bundle/json-io.jar
ivy/bundle/guava.jar
ivy/bundle/failureaccess.jar
jars/xmlrpc.jar
jars/ObjCBridge.jar
jars/jacksum.jar
jars/ObjCBridge.jar

Binary file not shown.

View File

@ -91,7 +91,7 @@ public enum HashType {
public String toString() {
return "SHA2";
}
},
};
// SHA3_384 {
//
@ -117,29 +117,6 @@ public enum HashType {
// }
// },
ED2K {
@Override
public Hash newHash() {
return JacksumHash.newED2K();
}
@Override
public VerificationFormat getFormat() {
return new VerificationFormat();
}
@Override
public ExtensionFileFilter getFilter() {
return MediaTypes.getTypeFilter("verification/ed2k");
}
@Override
public String toString() {
return "ED2K";
}
};
public abstract Hash newHash();
public abstract VerificationFormat getFormat();

View File

@ -1,33 +0,0 @@
package net.filebot.hash;
import jonelo.jacksum.algorithm.AbstractChecksum;
import jonelo.jacksum.algorithm.Edonkey;
public class JacksumHash implements Hash {
private final AbstractChecksum checksum;
public JacksumHash(AbstractChecksum checksum) {
this.checksum = checksum;
}
@Override
public void update(byte[] bytes, int off, int len) {
checksum.update(bytes, off, len);
}
@Override
public String digest() {
return checksum.getFormattedValue();
}
public static Hash newED2K() {
try {
return new JacksumHash(new Edonkey());
} catch (Exception e) {
throw new IllegalStateException(e);
}
}
}