formatting

This commit is contained in:
kim 2025-04-22 19:57:38 +01:00
commit c7c8edd982
2 changed files with 6 additions and 6 deletions

View file

@ -125,7 +125,7 @@ func (m *nollamas) Serve(c *gin.Context) {
nonce := query.Get("nollamas_solution") nonce := query.Get("nollamas_solution")
if nonce == "" || len(nonce) > 20 { if nonce == "" || len(nonce) > 20 {
// No attempted solution, just // An invalid solution string, just
// present them with new challenge. // present them with new challenge.
m.renderChallenge(c, challenge) m.renderChallenge(c, challenge)
return return
@ -190,8 +190,8 @@ func (m *nollamas) token(c *gin.Context, hash hash.Hash) string {
_, _ = hash.Write([]byte{m.diff}) _, _ = hash.Write([]byte{m.diff})
// Also seed the generated input with // Also seed the generated input with
// current time rounded to TTL, so with // current time rounded to TTL, so our
// our single comparison handles expiries. // single comparison handles expiries.
now := time.Now().Round(m.ttl).Unix() now := time.Now().Round(m.ttl).Unix()
_, _ = hash.Write([]byte{ _, _ = hash.Write([]byte{
byte(now >> 56), byte(now >> 56),

View file

@ -64,10 +64,10 @@
console.log('difficulty:', difficulty); console.log('difficulty:', difficulty);
// Prepare the worker with task function. // Prepare the worker with task function.
const worker = new Worker(workerTaskURL); const worker = new Worker(workerTaskURL);
worker.postMessage({ worker.postMessage({
challenge: challenge, challenge: challenge,
difficulty: difficulty, difficulty: difficulty,
}); });
// Set the main worker function. // Set the main worker function.