mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-06-18 12:49:59 -04:00
rename Utils.getBinaryHash() to Utils.getFileHexDigest()
Since this method works on any file, not just APKs or binaries...
This commit is contained in:
@@ -204,19 +204,19 @@ public class UtilsTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetBinaryHash() {
|
||||
public void testGetFileHexDigest() {
|
||||
File f = TestUtils.copyResourceToTempFile("largeRepo.xml");
|
||||
assertEquals("df1754aa4b56c86c06d7842dfd02064f0781c1f740f489d3fc158bb541c8d197",
|
||||
Utils.getBinaryHash(f, "sha256"));
|
||||
Utils.getFileHexDigest(f, "sha256"));
|
||||
f = TestUtils.copyResourceToTempFile("masterKeyIndex.jar");
|
||||
assertEquals("625d5aedcd0499fe04ebab81f3c7ae30c236cee653a914ffb587d890198f3aba",
|
||||
Utils.getBinaryHash(f, "sha256"));
|
||||
Utils.getFileHexDigest(f, "sha256"));
|
||||
f = TestUtils.copyResourceToTempFile("index.fdroid.2016-10-30.jar");
|
||||
assertEquals("c138b503c6475aa749585d0e3ad4dba3546b6d33ec485efd8ac8bd603d93fedb",
|
||||
Utils.getBinaryHash(f, "sha256"));
|
||||
Utils.getFileHexDigest(f, "sha-256"));
|
||||
f = TestUtils.copyResourceToTempFile("index.fdroid.2016-11-10.jar");
|
||||
assertEquals("93bea45814fd8955cabb957e7a3f8790d6c568eaa16fa30425c2d26c60490bde",
|
||||
Utils.getBinaryHash(f, "sha256"));
|
||||
Utils.getFileHexDigest(f, "SHA-256"));
|
||||
}
|
||||
// TODO write tests that work with a Certificate
|
||||
|
||||
|
||||
Reference in New Issue
Block a user