Review, Research, and Discussion
1- Explain what a “Singleton” is ?
singleton is a class that allows only a single instance of itself to be created and gives access to that created instance.
### 2- Explain how the Singleton pattern can be used with Node modules, specifically with classes?
you should do the module using class and then you export the module and requier it in other file .
Term | Discripe
- | -
Router Middleware | Middleware functions are functions that have access to the request object (req), the response object (res), and the next middleware function in the application’s request-response cycle andit used with specific router
Dynamic Module Loading| Dynamic loading is a mechanism by which a computer program can, at run time, load a library (or other binary) into memory, retrieve the addresses of functions and variables contained in the library, execute those functions or access those variables, and unload the
Singleton Pattern| a software design pattern that restricts the instantiation of a class to one “single” instance
CRUD| create, read, update, and delete (CRUD) are the four basic operations of persistent storage
Mock Testing| creating a fake version of an external or internal service that can stand in for the real one,
—
Securing Passwords
-
Passwords are the first line of defense against cyber criminals. It is the most vital secret of every activity we do over the internet and also a final check to get into any of your user account.
-
Cryptographic hash algorithms MD5, SHA1, SHA256, SHA512, SHA-3 are general purpose hash functions, designed to calculate a digest of huge amounts of data in as short a time as possible.
- The benefit of hashing is that if someone steals the database with hashed passwords, they only make off with the hashes and not the actual plaintext passwords
Basic Auth
basic access authentication is a method for an HTTP user agent (e.g. a web browser) to provide a user name and password when making a request.