add better styling and rename pow_client => nojscap
This commit is contained in:
parent
0a9434be1b
commit
40ee2ea272
3 changed files with 39 additions and 27 deletions
|
@ -39,6 +39,10 @@ def index():
|
|||
background: #cacaca;
|
||||
color: black;
|
||||
}}
|
||||
::selection {{
|
||||
background: #a60000;
|
||||
color: white;
|
||||
}}
|
||||
code {{
|
||||
white-space: break-spaces;
|
||||
background: black;
|
||||
|
@ -81,26 +85,26 @@ def index():
|
|||
$ cd NOJSCAP/client/</code>
|
||||
<p><br></p>
|
||||
<p>
|
||||
<code>$ python3 pow_client.py {challenge} {DIFFICULTY}</code>
|
||||
<code>$ python3 nojscap.py {challenge} {DIFFICULTY}</code>
|
||||
</p>
|
||||
<p>
|
||||
<strong>Go:</strong>
|
||||
</p>
|
||||
<p>
|
||||
<code>$ go run pow_client.go {challenge} {DIFFICULTY}</code>
|
||||
<code>$ go run nojscap.go {challenge} {DIFFICULTY}</code>
|
||||
</p>
|
||||
<p>
|
||||
<strong>Node.js:</strong>
|
||||
</p>
|
||||
<p>
|
||||
<code>$ node pow_client.js {challenge} {DIFFICULTY}</code>
|
||||
<code>$ node nojscap.js {challenge} {DIFFICULTY}</code>
|
||||
</p>
|
||||
<p>
|
||||
<strong>Rust:</strong>
|
||||
</p>
|
||||
<p>
|
||||
<code>$ rustc pow_client.rs -o pow_client_rs
|
||||
$ pow_client_rs {challenge} {DIFFICULTY}
|
||||
<code>$ rustc nojscap.rs -o nojscap_rs
|
||||
$ nojscap_rs {challenge} {DIFFICULTY}
|
||||
</code>
|
||||
<small>Requires Rust and sha2 crate if using the Cargo version.</small>
|
||||
</p>
|
||||
|
@ -108,8 +112,8 @@ $ pow_client_rs {challenge} {DIFFICULTY}
|
|||
<strong>C:</strong>
|
||||
</p>
|
||||
<p>
|
||||
<code>$ gcc -O2 -o pow_client pow_client.c -lssl -lcrypto
|
||||
$ ./pow_client {challenge} {DIFFICULTY}
|
||||
<code>$ gcc -O2 -o nojscap nojscap.c -lssl -lcrypto
|
||||
$ ./nojscap {challenge} {DIFFICULTY}
|
||||
</code>
|
||||
<small>Required: GCC or any C compiler. OpenSSL development libraries (libssl-dev on Debian-based systems)</small>
|
||||
</p>
|
||||
|
@ -130,7 +134,7 @@ def submit():
|
|||
challenge_store.pop(challenge)
|
||||
combined = (challenge + nonce).encode()
|
||||
h = hashlib.sha256(combined).digest()
|
||||
return "<p>Success! Valid nonce.</p><a href='/'>Try again</a>" if check_difficulty(h, DIFFICULTY) else "<p>Invalid nonce.</p><a href='/'>Try again</a>"
|
||||
return "<div style='text-align:center;'><h1>Success! Valid nonce.</h1><a href='/'>Try again</a></div>" if check_difficulty(h, DIFFICULTY) else "<div style='text-align:center;'><h1>Invalid nonce.</h1><a href='/'>Try again</a></div>"
|
||||
|
||||
app.run(port=3000)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue