开发者

Facebook File Names

开发者 https://www.devze.com 2023-03-23 17:40 出处:网络
I\'ve been checking out Facebook code lately and all of their images and files have names comprised of just random letters and numbers like \"FSEB6oLTK3I.png\", \"cWd6w4ZgtPx.png\", \"GsNJNwuI-开发者_

I've been checking out Facebook code lately and all of their images and files have names comprised of just random letters and numbers like "FSEB6oLTK3I.png", "cWd6w4ZgtPx.png", "GsNJNwuI-开发者_Python百科UM.gif". What do these names mean? Are they using some sort of naming system (if so, what is it?) or are the names just random?


They are generated completely randomly. And probably done for good reasons too. If this name was predicable then you could see someone's random upload by just knowing their name or id.

After generating a file name, they store the image on disk and store the image name in the database. Again this purely done for security reasons.


I think the names are generated completely random. If that's not the case, one would need a lot more data regarding the images/files and their uploaders, not to mention additional data about... well, anything that might be relevant for an upload.


I think that it is just random. They probably have a database that has all the random filenames

0

精彩评论

暂无评论...
验证码 换一张
取 消