Hi, I’m crooked.

Here’s the thing.

The Courier post in the community has been closed for several days, so nucleic acid tests must be done for the Courier.

Those little Courier men can not put the Courier into the Courier station, nor into the community, they can only set up stalls at the gate of the community, and then call everyone to pick up the Courier.

So I got a call from my brother:

Then I got up and went out.

Whoosh, soon ah, to the gate of the community.

I saw a delivery guy standing in front of a pile of packages, sorting.

Then I said to him: brother, I came to pick up the express.

He asked me: what’s the last number of my phone?

I answer: the tail number is 8.

Then he walked up to the longest line of the parcel and said, There are many in this pile. Just a moment, I’ll look for them for you.

And then he starts with the first one.

As smart as I am, I understood his principle of parcel splitting.

It’s just a Hash of the phone’s tail number. The same tail number in the same column, convenient for customers to take.

This is an array of length 10 plus a linked list, which is a crude HashMap.

HashMap< phone end number, express package >

Unfortunately, I have a lot more express packages ending in 8 than other express packages.

I asked him: this pile of express how so many ah? Are there so many people in our neighborhood whose cell phone number ends in 8?

The little brother said while searching: not only your community oh, this neighborhood express are here, so it looks a lot.

I was thinking to myself: This HashMap doesn’t make sense. It should be divided by the dimension of the cell first.

HashMap< cell, HashMap< phone end number, express package >>

So I asked my brother: why don’t you Hash according to the dimension of the community?

Obviously, the kid froze and didn’t understand what I was saying.

So I changed my opinion: why not divide the residential area first, and then divide the express delivery in the residential area according to the end number of the mobile phone?

The little elder brother think also didn’t think of with standard sichuanese reply ME: oh, the hand is not enough of, I cent heap heap of time also want to see village, angry of very. Oh, don’t worry. I’ll find you soon. Don’t worry

While we were talking, there were three people in line behind me waiting to pick up their packages:

And after half a minute, the little brother a look for 8 express still have to look for a while, he said to me: brother, so, you wait for a moment, I first look for the people behind, they should be very fast. Don’t waste time, don’t worry

Of course, I said no problem. Although I was in a hurry and the delivery was of the kind that I needed to use immediately, I still understood these little brothers very much. Wait a minute, it was not a problem.

So while I was picking up other people’s packages, I was still thinking: His data structure wasn’t good enough. There are a lot of bugs, like not being able to process my requests. The system has a lot of resistance.

Just as I was thinking, the other three express, as expected, soon found, after all, their tail number corresponding to the express altogether few.

The little brother then looked for my express, unexpectedly my express was at the last few in the queue. It’s like running a long linked list from beginning to end. Time complexity, not optimistic.

Obviously, when my brother found my delivery, he gave me a subtle smile, as if to announce his victory.

On the way home, I was thinking.

If I were his competitor, I would attack him based on his simple classification method.

For example, I go to a bunch of phone cards that end in 8, and then I order something really cheap and assign a carrier. Wouldn’t he have been able to process a customer’s package ending in 8, at least for a while?

In this way, to pick up the express users wait for a long time, the in the mind is not happy, and then point a complaint what…

Uh, wait…

This thing, isn’t it what I wrote earlier…

Let me tell you something about HashCode in secret. Hash collision attacks?

Well, that’s a lot of learning.

Thinking of this, INSTEAD of applauding my own cleverness, I thought I would quickly report my discovery to my wife and be sure to get her adoring eyes.

So also can’t help to quicken the pace.

When I got home, I opened the door and reported this amazing discovery. My wife asked me in reply: Isn’t that the same problem in the rookie station?

For a time, I asked excited: yes, if the rookie station also has such a problem, that I feedback, is not to enhance their work efficiency. You got to call the whole neighborhood for praise, right?

However, after I calmed down, I found that what I thought was too simple. The package placement logic of cainiao Courier station was definitely not based on such a simple algorithm as the Hash of the end number of the mobile phone.

For example, I looked at my previous pickup code and it looked like this:

I know it means parcel No. 5006, layer 1, shelf No. 2.

But the number 2-1-5006 is generated by their system, and I don’t know exactly how.

Not knowing their generation rules, that part of the attack is definitely not going anywhere.

Notice, why do I emphasize “partial attack” here?

Because I can just launch a violent DDos attack, order like crazy, and post can’t handle the volume of orders. For example, if you think about double 11 every year, it’s a DDos attack.

Just like in stalingrad battlefield, Li Yunlong led the northwest shanxi to attack the whole Ping ‘an county, after the anger value is up, the firepower is directly comprehensive coverage.

The Hash attack should be similar to the Battle of Watergate Bridge. A single point of attack on the Watergate Bridge can also affect the direction of the entire battle situation.

All right, I’ll stop there.

I can’t wait to open this package. As I said before, this package belongs to the kind that can be used immediately, which can be used by two people together and make people very excited.

Because inside it is this:

Buy two To play, she uses the gamepad, I use the keyboard:

The design of this game is very clever, two people play together, often play very excited.