Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to get one algorithm that meets the following conditions:
1. The result is unique.
2. result in finite integer set ranges 0~2^256, and the number of elements is random, the value of elements is random too, no repeat.
3. The solution is very difficult, but the verification result is very easy.

What I have tried:

for example :
input
     set: 0x00034 0x0000345 0x8892ff ...
     x : a byte array
out:
     y = f(set, x); y belong to set;  
verify:
     verify(set, x, y) = ok / false
Posted
Updated 9-Apr-18 21:30pm
Comments
Rick York 10-Apr-18 10:31am    
Rarely do I see a problem stated so vaguely. Given a finite set of integers you want some result but you have not described what kind of result you want in the slightest. It seems you want a unique result for every set. For all I know, a CRC32 algorithm might work for you. You can find tons of sample code for it here and elsewhere and it gives unique results for all sets of inputs. It also gives results that are not associative with the input meaning you can swap two input values and get a different result. You might need to extend it beyond 32 bits to cover the data range you need.
luckydogchina 10-Apr-18 21:52pm    
I want to design a minner algorithm in bitcoin.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900