static int md5OfFile_throughString_cached_interval = 10*60000; // forget after 10 minutes static Map, S>> md5OfFile_throughString_cached_map = syncExpiringMap(md5OfFile_throughString_cached_interval); // pair(pair(lastModified, size), md5) sS md5OfFile_throughString_cached(File f) { if (f == null) null; if (!f.exists()) ret md5OfFile_throughString(f); Pair, S> p = md5OfFile_throughString_cached_map.get(f); Pair modInfo = pair(lastModified(f), fileSize(f)); if (!eq(pairA(p), modInfo)) md5OfFile_throughString_cached_map.put(f, p = pair(modInfo, md5OfFile_throughString(f))); ret p.b; }