Updated fingerprints to base64url (closed #83)

Change-Id: I23779f2251afbbbc4ee1e5ec4bbe5bd5fa6ad040
diff --git a/Changes b/Changes
index 713b281..c2bb14d 100644
--- a/Changes
+++ b/Changes
@@ -1,10 +1,15 @@
+0.60.3 2022-03-10
+    - [cleanup] Updated fingerprints to base64url (closed #83)
+
+    !!! This will invalidate all VC caches. Please recache!
+
 0.60.2 2022-01-04
     - [security] More log4j updates (diewald)
     - [feature] Support for field value vector method (fixes #81; diewald)
 	- [cleanup] Moved and updated cache-tests from TestKrillCollectionIndex 
 	  to TestVirtualCorpusCache (resolved #44; margaretha)
     - [feature] Added a Krill API returning textSigles for a given 
-      corpus query (margaretha)  
+      corpus query (margaretha)
 
 0.60.1 2021-12-17
     - [feature] Added vc loading from classpath (margaretha)
diff --git a/pom.xml b/pom.xml
index efa4ada..83e069f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,7 +35,7 @@
 
   <groupId>de.ids_mannheim.korap</groupId>
   <artifactId>Krill</artifactId>
-  <version>0.60.2</version>
+  <version>0.60.3</version>
   <packaging>jar</packaging>
 
   <name>Krill</name>
diff --git a/src/main/java/de/ids_mannheim/korap/KrillIndex.java b/src/main/java/de/ids_mannheim/korap/KrillIndex.java
index 75a7acf..6421226 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillIndex.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillIndex.java
@@ -1871,7 +1871,6 @@
         for (LeafReaderContext context : leaves) {
             String fp = Fingerprinter.create(
                     context.reader().getCombinedCoreAndDeletesKey().toString());
-            fp = Fingerprinter.normalizeSlash(fp);
             fingerprints.add(fp);
         }
         return fingerprints;
diff --git a/src/main/java/de/ids_mannheim/korap/cache/VirtualCorpusCache.java b/src/main/java/de/ids_mannheim/korap/cache/VirtualCorpusCache.java
index 14f82db..b14aeb5 100644
--- a/src/main/java/de/ids_mannheim/korap/cache/VirtualCorpusCache.java
+++ b/src/main/java/de/ids_mannheim/korap/cache/VirtualCorpusCache.java
@@ -101,7 +101,6 @@
         for (LeafReaderContext context : index.reader().leaves()) {
             leafFingerprint = Fingerprinter.create(
                     context.reader().getCombinedCoreAndDeletesKey().toString());
-            leafFingerprint = Fingerprinter.normalizeSlash(leafFingerprint);
             
             getDocBits(vcId, leafFingerprint, () -> {
                 try {
diff --git a/src/main/java/de/ids_mannheim/korap/collection/VirtualCorpusFilter.java b/src/main/java/de/ids_mannheim/korap/collection/VirtualCorpusFilter.java
index 489f944..e0831bb 100644
--- a/src/main/java/de/ids_mannheim/korap/collection/VirtualCorpusFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/collection/VirtualCorpusFilter.java
@@ -35,7 +35,6 @@
             throws IOException {
         String leafFingerprint = Fingerprinter.create(
                 context.reader().getCombinedCoreAndDeletesKey().toString());
-        leafFingerprint = Fingerprinter.normalizeSlash(leafFingerprint);
         
         DocBits docBits = VirtualCorpusCache.getDocBits(vcId, leafFingerprint,
                 () -> {
diff --git a/src/main/java/de/ids_mannheim/korap/util/Fingerprinter.java b/src/main/java/de/ids_mannheim/korap/util/Fingerprinter.java
index 494477e..52d0d57 100644
--- a/src/main/java/de/ids_mannheim/korap/util/Fingerprinter.java
+++ b/src/main/java/de/ids_mannheim/korap/util/Fingerprinter.java
@@ -24,14 +24,10 @@
         };
 
         md.update(key.getBytes());
-        String code = new String(Base64.getEncoder().encode(md.digest()));
+        String code = new String(Base64.getUrlEncoder().encode(md.digest()));
+        
         md.reset();
         return code;
 
     }
-    
-    public static String normalizeSlash (String code) {
-        return code.replace("/", "_");
-    }
-
 }
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestIndexRevision.java b/src/test/java/de/ids_mannheim/korap/index/TestIndexRevision.java
index b6d38a6..82fab27 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestIndexRevision.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestIndexRevision.java
@@ -44,7 +44,7 @@
         ki.commit();
 
         String x3 = ki.getFingerprint();
-        assertEquals("fS3GqnKynhPQ5wFyC9/XWw==",x3);
+        assertEquals("fS3GqnKynhPQ5wFyC9_XWw==",x3);
 
 
         // Check if the same changes will have the same effect