mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-09 22:09:47 -04:00
Remove ED2K support
This commit is contained in:
parent
3f3643ad71
commit
b01e0f3dc8
@ -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.
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user