HowProgrammingWorks / NodejsStarterKit

Starter Kit for Node.js 16 or later, minimum dependencies 🚀
http://metarhia.com
MIT License
463 stars 102 forks source link

Random to crypto #31

Closed mihmul83 closed 4 years ago

mihmul83 commented 4 years ago

Replace Math.random() to cryptographically strong pseudo-random crypto.randomBytes Replace Math.floor to bitwise or

mihmul83 commented 4 years ago

I think that maybe to somehow soften the conditions for the Eslint rule "linebreak-style". Because I had problems with it on windows and in the end I made 5 commits for 4 linesof code, that makes me a little sad. Maybe we should add the file .eslintignore in .gitignore?

tshemsedinov commented 4 years ago

@mihmul83 line breaks are not a problem, it is a standard in programming and all tools have workaround for windows, for example git have autocrlf configuration parameter, see: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration Also all IDE supports different line ending, most of them have autodetection but try to configure it in IDE preferences.

tshemsedinov commented 4 years ago

I am going to land this PR

tshemsedinov commented 4 years ago

Landed in https://github.com/HowProgrammingWorks/NodejsStarterKit/commit/257cabd27e1fed613504e08e3cbf853a3a5a6f60

tshemsedinov commented 4 years ago

Squashed and landed, @mihmul83, thanks for your contribution!