-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathalgoritmos.txt
65 lines (39 loc) · 920 Bytes
/
algoritmos.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
And they were all amazed, insomuch that they questioned among themselves, saying, What is this? a new teaching!
ID = Init + increment
/* Generator initialization at system bootstrap */
Init = InitGenerator();
/* Protocol ID generation */
tries = MAX_TRIES;
do{
Init= ComputeInit(Init);
Var = ComputeFunction(Var);
ID = Init + Var;
if(SuitableId(ID))
return ID;
else
Init= RecoverInit(Init);
Var= RecoverVar(Var)
tries--;
}while(tries);
return(ERROR);
Random:
ComputeFunction= rand();
RecoverInit= Init;
RecoverVar:
si es random -> random
sino Var+1;
-----------------------------
Hashbased:
ComputeInit= Hash()
ComputeVar= Var +1;
RecoverInit= Init
RecoverVar= Var+1;
---
Random increments
InitGenerator= random()
COmputeInit= Init;
ComputeVar= var + rand() % STEP;
----
InitGenerator=0;
ComputeInit= Hash(IP, tries)
------------