How does the URL of a text for rice be generated?

Source: Internet
Author: User

Fanfou.com/statuses/xmvsu3smr8s

This is a typical URL, I would like to know how the following random letter string is generated? exists in the database? Do you want to query the database for duplicates when you build it?

Reply content:

Fanfou.com/statuses/xmvsu3smr8s

This is a typical URL, I would like to know how the following random letter string is generated? exists in the database? Do you want to query the database for duplicates when you build it?

Reference Weibo 62-binary

Twitter's tweet ID contains timestamps, server numbers, and serial numbers.

Https://dev.twitter.com/docs/twitter-ids-json-and-snowflake

Why is Snowflake?

Snowflake is a service we'll be the using to generate unique Tweet IDs. These Tweet IDs is unique 64bit unsigned integers, which, instead of being sequential like the current IDs, is based on Time. The full ID is composed of a timestamp, a worker number, and a sequence number.

Tweet IDs can be sorted directly by number, so timestamps should be arranged in the front section, so the clocks of each server must be kept in sync.

Rice no ID algorithm is not public, should be similar to the idea.

I guess the background with pure numbers to make sure uniqueness, and then through a certain algorithm, shown as: xmvsu3smr8s, in fact, in the background data table, there may be a pure number of ID field.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.