YouTube URL algorithm?

后端 未结 11 1872
遇见更好的自我
遇见更好的自我 2020-12-04 09:39

How would you go about generating the unique video URL\'s that YouTube uses?

Example:

  • http://www.youtube.com/watch?v=CvUN8qg9lsk
11条回答
  •  情歌与酒
    2020-12-04 10:34

    Your best bet is probably to simply generate random strings, and keep track (in a DB for example) of which strings you've already used so you don't duplicate. This is very easy to implement and it cannot fail if properly implemented (no duplicates, etc).

提交回复
热议问题