Skip to content

lib Miscellaneous

Yichao Yu edited this page Jan 21, 2021 · 1 revision

Account

Enumeration values used to pass information between the server and clients as well as validation functions. These are shared between the server and client so that the two have consistent implementations. For the validation functions, the server will always performance the final test of the user input so that a malicious user cannot break the system. However, the validation will also be performed on the client to provide faster user feedback and to reduce the workload/network bandwidth from a normal client.

Crypto functions

Used to compute MD5 hash which is used in the gravatar URL. On the client (lib/crypto_client.js), we use md5 function provided by blueimp-md5 (loaded in pages/_document.js) and on the server (server/crypto.js) we use the crypto package.

Event utilities

Useful functions to handle HTML events. This one is of course used only on the client.

sleep function

Currently only used on the server. It's here since it could be useful on the client...

Clone this wiki locally