eu.mais_h.mathsync.Defaults Maven / Gradle / Ivy
package eu.mais_h.mathsync;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.binary.StringUtils;
import eu.mais_h.mathsync.digest.Sha1Digester;
class Defaults {
private static final BucketSelector DEFAULT_SELECTOR = PadAndHashBucketSelector.newInstance(Sha1Digester.get(), 3);
static int ibfSizeFromLevel(int level) {
return (int)Math.pow(2, level);
}
static BucketSelector defaultSelector() {
return DEFAULT_SELECTOR;
}
static String serialize(byte[] array) {
return StringUtils.newStringUtf8(Base64.encodeBase64(array, false));
}
static byte[] deserialize(String serialized) {
return Base64.decodeBase64(serialized);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy