11
11
}
12
12
13
13
# out {
14
- padding : 10px 0 ;
14
+ margin-top : 10px ;
15
+ padding : 10px 5px ;
16
+ color : # 444 ;
17
+ line-height : 1.5 ;
18
+ }
19
+
20
+ # out small {
21
+ padding : 5px ;
22
+ background-color : # eee ;
15
23
}
16
24
17
25
# N {
24
32
< body >
25
33
< h1 > < a href ="https://github.com/dchest/scrypt-async-js "> scrypt-async-js</ a > demo</ h1 >
26
34
< form onsubmit ="calculate(); return false ">
27
- < p > Password: < input name ="password " type ="text " value ="password " size ="32 "> </ p >
28
- < p > Salt: < input name ="salt " type ="text " value ="salt " size ="32 "> </ p >
29
- < p > interruptStep: < input name ="interruptStep " type ="text " value ="0 " size ="8 "> </ p >
30
- < p > logN: < input name ="logN " type ="text " value ="11 " size ="4 " onkeypress ="updateN() "
31
- onchange ="updateN() " onkeyup ="updateN() "
32
- onblur ="updateN() "> < span id ="N "> </ p >
33
- < p > r: < input name ="r " type ="text " value ="8 " size ="4 "> </ p >
34
- < p > p: < input name ="p " type ="text " value ="1 " size ="4 "> </ p >
35
- < input type ="submit " name ="btn " value ="Calculate " />
35
+ < p >
36
+ < label for ="password "> Password:</ label >
37
+ < input id ="password " name ="password " type ="text " value ="password " size ="32 ">
38
+ </ p >
39
+ < p >
40
+ < label for ="salt "> Salt:</ label >
41
+ < input id ="salt " name ="salt " type ="text " value ="salt " size ="32 ">
42
+ </ p >
43
+ < p >
44
+ < label for ="interruptStep "> interruptStep:</ label >
45
+ < input id ="interruptStep " name ="interruptStep " type ="text " value ="0 " size ="8 ">
46
+ </ p >
47
+ < p >
48
+ < label for ="logN "> logN:</ label >
49
+ < input id ="logN " name ="logN " type ="text " value ="11 " size ="4 "
50
+ onkeypress ="updateN() " onkeyup ="updateN() "
51
+ onblur ="updateN() " onchange ="updateN() " >
52
+ < span id ="N ">
53
+ </ p >
54
+ < p >
55
+ < label for ="r "> r:</ label >
56
+ < input id ="r " name ="r " type ="text " value ="8 " size ="4 ">
57
+ </ p >
58
+ < p >
59
+ < label for ="p "> p:</ label >
60
+ < input id ="p " name ="p " type ="text " value ="1 " size ="4 ">
61
+ </ p >
62
+ < p >
63
+ < label for ="encoding "> Encoding:</ label >
64
+ < select id ="encoding " name ="encoding ">
65
+ < option value ="hex " selected > hex</ option >
66
+ < option value ="base64 "> base64</ option >
67
+ < option value ="binary "> binary</ option >
68
+ </ select >
69
+ </ p >
70
+ < input type ="submit " name ="btn " value ="Calculate " />
36
71
</ form >
37
72
< div id ="out "> </ div >
38
73
@@ -57,6 +92,7 @@ <h1><a href="https://github.com/dchest/scrypt-async-js">scrypt-async-js</a> demo
57
92
var logN = f . logN . value ;
58
93
var r = f . r . value ;
59
94
var p = f . p . value ;
95
+ var encoding = f . encoding . value ;
60
96
61
97
btn . disabled = true ;
62
98
btn . value = 'Wait...' ;
@@ -70,11 +106,11 @@ <h1><a href="https://github.com/dchest/scrypt-async-js">scrypt-async-js</a> demo
70
106
p : p ,
71
107
dkLen : 32 ,
72
108
interruptStep : interruptStep ,
73
- encoding : 'hex'
109
+ encoding : encoding
74
110
} ,
75
111
function ( res ) {
76
112
var t2 = ( ( new Date ( ) ) . getTime ( ) - t1 ) ;
77
- out . innerHTML = 'scrypt : <b>' + t2 + ' ms</b> ' + res + '' ;
113
+ out . innerHTML = 'Time : <b>' + t2 + ' ms</b><br>Result: <small> ' + res + '</small> ' ;
78
114
btn . disabled = false ;
79
115
btn . value = 'Calculate' ;
80
116
} ) ;
0 commit comments