3 ms·
Where is the server source code? I'm not seeing where messages are stored/transmitted to clients? Also https://github.com/bmmayer/ephchat/issues/2 https://gith
by sarciszewski 12y ago
Where is the server source code? I'm not seeing where messages are stored/transmitted to clients?
Also https://github.com/bmmayer/ephchat/issues/2 https://github.com/bmmayer/ephchat/issues/2
- joeyspn 12y agoIt is a simple websockets chat using Firebase... https://github.com/firebase/firechat https://github.com/firebase/firechat
- system_32 12y agoYou criticized about the random code generation function. Could you explain why it is bad? Though I code, I am no expert and would really like to know.
- sarciszewski 12y agoThis is the offending code: https://github.com/bmmayer/ephchat/blob/ec375c7974ea825f887ff4ca1cca2349018a187e/php/functions.php#L4-L20 https://github.com/bmmayer/ephchat/blob/ec375c7974ea825f887f... This is the proper way to do it (h/t @tptacek): http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/ http://sockpuppet.org/blog/2014/02/25/safely-generate-random... mt_srand() + rand() is just hilarious. The md5(uniquid()) thing is a common randomness anti-pattern in PHP projects that needs to die in a fire. In PHP, a very brief example of the code to achieve the proper way of generating randomness looks like the snippet I posted in the issue.