snollygolly / sourceio-automation

:video_game: A bot to automatically play s0urce.io for you
MIT License
29 stars 27 forks source link

Using base64 to recognize a word #17

Closed abxu closed 7 years ago

abxu commented 7 years ago

Hi,

I have updated the database to work with the base64 of an image. The key is a hash of the base64 with a hash function similar to that of Java. This will avoid regenerating the database several times.

snollygolly commented 7 years ago

Solid work! I was on the write track with hashing, but this is much better than my solution. Let me ask, how likely are collisions with this hashing method?

abxu commented 7 years ago

Good question, I'm not sure but there are actually ~180 words and it's a 32 bit hash function

Pr(collision)\geq 1-e(-\frac{180*179}{2*2^{32}})\approx 0.00000375089

EDIT: Argh! No latex support

prcollision