![JAR search and dependency download from the Maven repository](/logo.png)
eu.erasmuswithoutpaper.rsaaes.LruCache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ewp-rsa-aes Show documentation
Show all versions of ewp-rsa-aes Show documentation
Encrypt and decrypts data using the ewp-rsa-aes128gcm encryption scheme, as defined here: https://github.com/erasmus-without-paper/ewp-specs-sec-rsa-aes128gcm
package eu.erasmuswithoutpaper.rsaaes;
import java.util.LinkedHashMap;
import java.util.Map;
class LruCache extends LinkedHashMap {
private static final long serialVersionUID = 1L;
private final int maxEntries;
LruCache(int maxEntries) {
super((int) (maxEntries * 1.3f + 1), 0.75f, true);
this.maxEntries = maxEntries;
}
@Override
protected boolean removeEldestEntry(Map.Entry eldest) {
return this.size() > this.maxEntries;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy