- tested successfully z-presentation of yacy seed encoding

- added alternative switch that takes shortest representation as yacy seed string encoding

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4491 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 17 years ago
parent 22b8525c84
commit 36b898ca7a

@ -129,4 +129,10 @@ public class crypt {
}
}
public static void main(String[] args) {
String teststring="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
System.out.println("Teststring = " + teststring);
System.out.println("enc-b result = " + simpleDecode(simpleEncode(teststring, null, 'b'), null));
System.out.println("enc-z result = " + simpleDecode(simpleEncode(teststring, null, 'z'), null));
}
}

@ -818,7 +818,11 @@ public class yacySeed {
public final String genSeedStr(String key) {
// use a default encoding
return this.genSeedStr('z', key);
String z = this.genSeedStr('z', key);
String b = this.genSeedStr('b', key);
// the compressed string may be longer that the uncompressed if there is too much overhead for compression meta-info
// take simply that string that is shorter
if (b.length() < z.length()) return b; else return z;
}
public final synchronized String genSeedStr(char method, String key) {

Loading…
Cancel
Save