Best ways to handle failure to find a collision-free hash
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia tracciando la ricerca senza collisioni del builder e il comportamento di Get, concentrandoti sugli input FNV come c e c2 e sul seed casuale basato sul tempo descritto nell’issue. Esamina quindi il comportamento e i test del package esistente, poi definisci se i tentativi ripetuti, la possibilità di consentire collisioni o il fallback rientrano in questa library; il lavoro è completato quando sono disponibili una decisione documentata e il relativo ambito concordato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
(I apologize if this is out of scope for this library, and for my relatively shallow understanding of MPHs.)
Using the FNV hash func and even some simple inputs (e.g., keys c and c2, where c is any character), the builder often fails to find a collision-free hash. This is not a limitation of this particular project; implementations of the same algorithm in other languages also frequently fail on this class of inputs. (I say "often" and "frequently" because the random seed is the current time, and sometimes it succeeds.)
Is there a generally accepted solution for handling this occurrence, such as retrying the generation with a different random seed? Or allowing a small number of collisions (and iterating over the collisions in Get) if the cardinality is small? (It might make the most sense to add support for these things in external code, not in this core mph lib. But I notice that gperf supports producing imperfect hashes, so there is some precedent for including them.)
So, basically, how do other people handle the failure to find a collision-free hash in their own code? (Just fall back to a map or another hashing scheme?)
- Lingua principale
- Go
- Stelle
- 191
- Fork
- 21
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di alecthomas/mph
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
alecthomas/mph#10 · 1 commento · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
alecthomas/mph#8 · 1 commento ·
-
Builder & mmapAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
alecthomas/mph#3 · 3 commenti ·
-
Integer key and valueAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
alecthomas/mph#2 · 7 commenti · 1 reazione ·
Tutte le issue di alecthomas/mph
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
fluxcd/notification-controller#1441 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
OneBusAway/maglev#2145 ·
I maintainer di solito rispondono entro 2 giorni
-
priority/medium status/ready type/chore
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
discobox-ai/discobox#1357 ·
I maintainer di solito rispondono entro 1 giorno
-
TestPseudoLocaleRemote fails now and then: it types the code before the laptop asks for itForse già presa @fzn0x l’ha presa oggi. Apertabug priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
edit_file diff rendering panics on invalid UTF-8 textForse già presa @TDnorthgarden l’ha presa oggi. Apertaarea/tui
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
docker/docker-agent#4955 ·
I maintainer di solito rispondono entro 1 giorno