I've got a lot of little ideas for how this module could be improved and before I started writing patches for everything like I'm currently doing I was wondering if you would be interested in me helping co-maintain Hashcash?

Ideas:
1. Bring the code to proper coding standards (see current patches).
2. Use jQuery to minimize custom JavaScript code writing in hashcash.js
3. Convert the SHA JS code to the jquery.sha1.js plugin and minify the JavaScript.
4. Convert the database to use proper fields for each part of the hashcash. This way we store things the proper way, can easily sort/remove by timestamp, etc.
- hash: varchar of the sha1 of the hashcash (primary key)
- timestamp: integer of the actual UNIX timestamp of when the hashcash was generated
- form_id: varchar of the form_id
- hostname: varcahr of the ip address
- domain: the $global cookie_domain value
- salt: the random string generated by the sha1 to get a valid hashcash value
5. Clean up the logic inside hashcash_form_alter() and hashcash_validate().

Let me know if this sounds like a good idea.

Comments

sdrycroft’s picture

Status: Active » Fixed
  1. Code works for me.
  2. If there were an advantage to doing this, then I could understand doing it, but given that there isn't, I'll keep my code as simple as it is.
  3. jquery.sha1.js looks to be identical to the SHA1 function I'm already using, again, there's no point to doing this.
  4. There is no need to store all these additional fields, the time is stored as it is, as that is how the Hashcash standard is defined. The table is only there to check for repetition, and that is all.
  5. ?

Anyhow, thanks for the comments David.

dave reid’s picture

By coding standards I meant the coding standards. There are lots of no-spaces between function declaration and first opening curly braces, between parameters in function calls, etc. Hook should be documented with "Implementation of hook_foo().". All that good stuff makes things more readable for other developers that want to help and submit patches or features.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.