Score:1

Cryptographic hash function to map interval onto itself

cz flag

Is there any existing approach to construct perfect hash function that map [0, M) to [0, M)? It should be one to one mapping and one-way.

f(value, salt) -> hashed_value
us flag
It's odd to call it a hash function if it's 1-to-1. You're looking for a one-way permutation.
Tomilov Anatoliy avatar
cz flag
@Mikero really. Thanks.
Maarten Bodewes avatar
in flag
One one-way permutation is defined [here](https://cstheory.stackexchange.com/questions/3652/one-way-permutations-without-trapdoor#:~:text=https%3A//cstheory.stackexchange.com/a/3655/16703). Not sure about the security, but it is number oriented.
Tomilov Anatoliy avatar
cz flag
Thank you. Should I delete the question?
Maarten Bodewes avatar
in flag
Uh, I guess you could since this was about identifying the function mostly. If the question comes along again we can repeat, as I'm not sure anybody would find this one. And you've got your answer anyway :)
kelalaka avatar
in flag
Are you looking something like [Fisher–Yates shuffle](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle)?
Maarten Bodewes avatar
in flag
Maybe it is me, but I'm not understanding that comment. Where is the sequence? A range is not a sequence by itself and you're not going to shuffle the entire range to build a permutation I would assume.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.