org.cryptomator.siv.ThreadLocals Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of siv-mode Show documentation
Show all versions of siv-mode Show documentation
RFC 5297 SIV mode: deterministic authenticated encryption
package org.cryptomator.siv;
import java.util.function.Supplier;
class ThreadLocals {
static ThreadLocal withInitial(Supplier supplier) {
// ThreadLocal.withInitial is unavailable on Android 7.x
return new ThreadLocal() {
@Override
protected S initialValue() {
return supplier.get();
}
};
}
}