Git Product home page Git Product logo

Comments (9)

AbrahamCaiJin avatar AbrahamCaiJin commented on July 3, 2024

image
image
都会存在的

from commonutillibrary.

LuckyJayce avatar LuckyJayce commented on July 3, 2024

“Aa“和”BB“的hashcode一样
如果key为“Aa“的取到了之前key为”BB“存的缓存,这不是有问题么?

from commonutillibrary.

AbrahamCaiJin avatar AbrahamCaiJin commented on July 3, 2024

这个问题避免不了吧?不管怎么做都是存在的,就像HashMap一样

from commonutillibrary.

LuckyJayce avatar LuckyJayce commented on July 3, 2024

难道key不是唯一值么?用key做为文件的文件名,不就不重复了
也可以key md5以下防止key的暴露

from commonutillibrary.

LuckyJayce avatar LuckyJayce commented on July 3, 2024

hashMap 的设计是相同的hashcdoe值放在同一个hash桶里,通过key找到对应的hash桶,然后桶里通过key找出相同key的值,又不是直接通过hashcode取必须要key比较一下的

from commonutillibrary.

AbrahamCaiJin avatar AbrahamCaiJin commented on July 3, 2024

你的意思是存的时候用文件名存吗?或者md以后再作为key使用吗?

from commonutillibrary.

LuckyJayce avatar LuckyJayce commented on July 3, 2024

private File newFile(String key) {
return new File(cacheDir, md5(key));
}

from commonutillibrary.

AbrahamCaiJin avatar AbrahamCaiJin commented on July 3, 2024

好的,谢谢大佬指导

from commonutillibrary.

AbrahamCaiJin avatar AbrahamCaiJin commented on July 3, 2024

大佬,你看看还有没有什么其他不对的地方,直接pull上来吧,多谢大佬

from commonutillibrary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.