<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dunsin</title>
    <description>The latest articles on DEV Community by Dunsin (@dunsincodes).</description>
    <link>https://dev.to/dunsincodes</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1544237%2F36e27e0d-ed65-4f7e-b9c0-17501cb34d5c.jpeg</url>
      <title>DEV Community: Dunsin</title>
      <link>https://dev.to/dunsincodes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dunsincodes"/>
    <language>en</language>
    <item>
      <title>Self-Hosting Jitsi Meet with Docker and Cloudflare Tunnel</title>
      <dc:creator>Dunsin</dc:creator>
      <pubDate>Wed, 02 Apr 2025 12:07:07 +0000</pubDate>
      <link>https://dev.to/dunsincodes/self-hosting-jitsi-meet-with-docker-and-cloudflare-tunnel-1hdl</link>
      <guid>https://dev.to/dunsincodes/self-hosting-jitsi-meet-with-docker-and-cloudflare-tunnel-1hdl</guid>
      <description>&lt;h2&gt;
  
  
  What is Jitsi?
&lt;/h2&gt;

&lt;p&gt;Jitsi is a free open source, and encrypted video conferencing platform that allows users to start or join meetings directly in their browser without requiring account creation and software downloads. Jitsi also allows you to self host on your own server.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why should you use Jitsi?
&lt;/h3&gt;

&lt;p&gt;Jitsi provides secure, high-quality video conferencing with end-to-end encryption, ephemeral meeting rooms, and no account requirement for quick access. It supports WebRTC for seamless browser compatibility without extra software. The platform is highly scalable, allowing unlimited participants without artificial restrictions. Its user-friendly interface makes setup and use easy, even for non-technical users. Jitsi also integrates with third-party services like Slack and calendars for improved workflow. Its open-source nature ensures continuous updates, transparency, and flexibility, backed by an active community offering extensive documentation and support.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why you would want to self host Jitsi?
&lt;/h2&gt;

&lt;p&gt;Self-hosting Jitsi offeres enhanced control, privacy, and customization of your video conferencing need.&lt;/p&gt;

&lt;p&gt;Which means you get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To own your own infrastructure: You have complete control over the server, network rules and security settings&lt;/li&gt;
&lt;li&gt;Scalability and Performance: You can scale your jitsi instance to meet your specific needs.&lt;/li&gt;
&lt;li&gt;Data Control: You have full control of your user data when your selfhosted version is used which enhances privacy&lt;/li&gt;
&lt;li&gt;Vendor Lock-in: It reduces the reliance on a single vendor allowing for flexibility&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How Jitsi Works Under the Hood
&lt;/h2&gt;

&lt;p&gt;Jitsi consists of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Jitsi Meet&lt;/code&gt; - is the &lt;a href="https://medium.com/@fengliu_367/getting-started-with-webrtc-a-practical-guide-with-example-code-b0f60efdd0a7" rel="noopener noreferrer"&gt;WebRTC&lt;/a&gt; compatible JavaScript application that uses Jitsi Videobridge to provide video conferencing&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Jitsi Videobridge (JVB)&lt;/code&gt; - is the server that is designed to route video streams amongst participants in a conference.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Jitsi Conference Focus (jicofo)&lt;/code&gt; - is a server component that manages media sessions and acts as a load balancer between each of the participants and the video bridge.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Jitsi Gateway to SIP (jigasi)&lt;/code&gt; - is a server application that allows regular SIP clients to join Jitsi Meet conferences&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Jitsi Broadcasting Infrastructure (jibri)&lt;/code&gt; - a set of tools for recording and streaming a jitsi meet conference that works by launching a chrome instance rendered in a virtual framebuffer and capturing and encoding the output with ffmpeg&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Prosody&lt;/code&gt; - &lt;a href="https://xmpp.org/" rel="noopener noreferrer"&gt;XMPP&lt;/a&gt; server used for signalling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fucmri1ndwfq71uqwq59g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fucmri1ndwfq71uqwq59g.png" alt="image.png" width="751" height="571"&gt;&lt;/a&gt;&lt;br&gt;
How it all comes together - Source: &lt;a href="https://jitsi.github.io/handbook/docs/architecture" rel="noopener noreferrer"&gt;Architecture | Jitsi Meet&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Self-Hosting Jitsi Meet with Docker and Cloudflare Tunnel&lt;/strong&gt;
&lt;/h2&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Step 1: Install Required Software&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before setting up Jitsi, you need &lt;strong&gt;Docker, Docker Compose, and WSL&lt;/strong&gt; (Windows Subsystem for Linux) if you're using Windows.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install Docker &amp;amp; Docker Compose&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Follow the &lt;strong&gt;official Docker installation guide&lt;/strong&gt; for your OS&lt;/li&gt;
&lt;li&gt;Verify installation:
&lt;code&gt;docker -v
docker-compose -v&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Install WSL (Windows Users Only)&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're on Windows, install WSL and set &lt;strong&gt;Ubuntu&lt;/strong&gt; as your default distribution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  ```
  wsl --install -d Ubuntu
  ```
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;Step 2: Clone the Jitsi Docker Repository&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Jitsi provides a &lt;strong&gt;Docker Compose setup&lt;/strong&gt; for easy self-hosting.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Clone the repository:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```
git clone https://github.com/jitsi/docker-jitsi-meet &amp;amp;&amp;amp; cd docker-jitsi-meet
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copy the &lt;strong&gt;example environment file&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```
cp env.example .env
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Step 3: Configure Jitsi Environment Variables&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Open the &lt;code&gt;.env&lt;/code&gt; file and configure the following settings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  ```
  # Set your public domain (replace with your actual subdomain)
  PUBLIC_URL=meet.&amp;lt;YOUR_DOMAIN&amp;gt;

  # Disable automatic SSL since we will use Cloudflare Tunnel
  ENABLE_LETSENCRYPT=0

  # Enable authentication (optional)
  ENABLE_AUTH=0
  ENABLE_GUESTS=1

  # Enable WebSockets (important for mobile support)
  ENABLE_XMPP_WEBSOCKET=1
  ```
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💡 &lt;strong&gt;Note&lt;/strong&gt;: If you plan to &lt;strong&gt;restrict meeting creation&lt;/strong&gt;, set &lt;code&gt;ENABLE_AUTH=1&lt;/code&gt; and configure authentication later.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Step 4: Start Jitsi Services&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Run Jitsi using &lt;strong&gt;Docker Compose&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```
docker-compose up -d
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify that all services are running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```
docker ps
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see containers for:&lt;/p&gt;

&lt;p&gt;✅ &lt;code&gt;prosody&lt;/code&gt; (XMPP server)&lt;/p&gt;

&lt;p&gt;✅ &lt;code&gt;web&lt;/code&gt; (main frontend)&lt;/p&gt;

&lt;p&gt;✅ &lt;code&gt;jicofo&lt;/code&gt; (conference management)&lt;/p&gt;

&lt;p&gt;✅ &lt;code&gt;jvb&lt;/code&gt; (video bridge)&lt;/p&gt;

&lt;p&gt;If everything works, your Jitsi server should be accessible &lt;strong&gt;locally&lt;/strong&gt; via &lt;code&gt;http://localhost:8000&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Step 5: Expose Jitsi to the Internet Using Cloudflare Tunnel&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you don’t have a &lt;strong&gt;static IP&lt;/strong&gt;, Cloudflare Tunnel allows you to expose Jitsi &lt;strong&gt;without opening firewall ports&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Step 5.1: Set Up Cloudflare Tunnel&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Create a Cloudflare Account&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Sign up at &lt;a href="https://dash.cloudflare.com/" rel="noopener noreferrer"&gt;https://dash.cloudflare.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Add your domain to Cloudflare&lt;/li&gt;
&lt;li&gt;Create a &lt;strong&gt;subdomain&lt;/strong&gt; for Jitsi (e.g., meet.)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install Cloudflare Tunnel (&lt;code&gt;cloudflared&lt;/code&gt;)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```
sudo wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -O /usr/local/bin/cloudflared
sudo chmod +x /usr/local/bin/cloudflared
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Authenticate Cloudflare Tunnel&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ```
 cloudflared tunnel login
 ```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- This opens a browser to authenticate with Cloudflare.
- Select your **Cloudflare domain** (e.g., &amp;lt;YOUR_DOMAIN&amp;gt;).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create a Cloudflare Tunnel&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ```
 cloudflared tunnel create jitsi-tunnel
 ```
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;This generates a &lt;strong&gt;tunnel ID&lt;/strong&gt; and a credentials file:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ```
 /root/.cloudflared/&amp;lt;tunnel-id&amp;gt;.json
 ```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configure the Tunnel&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a config file:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ```
 nano ~/.cloudflared/config.yml
 ```
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Add the following:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ```
 tunnel: &amp;lt;tunnel-id&amp;gt;
 credentials-file: /root/.cloudflared/&amp;lt;tunnel-id&amp;gt;.json

 ingress:
   - hostname: meet.&amp;lt;YOUR_DOMAIN&amp;gt;
     service: http://localhost:8000
   - service: http_status:404
 ```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Run the Cloudflare Tunnel&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```
cloudflared tunnel run jitsi-tunnel
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Set Up DNS in Cloudflare&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the &lt;strong&gt;Cloudflare Dashboard&lt;/strong&gt;, go to &lt;strong&gt;DNS Settings&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Add a &lt;strong&gt;CNAME record&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Name&lt;/strong&gt;: &lt;code&gt;meet.&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Target&lt;/strong&gt;: &lt;code&gt;&amp;lt;tunnel-id&amp;gt;.cfargotunnel.com&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Step 6: Fix Cloudflare &amp;amp; Jitsi Issues&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Issue 1: 405 Not Allowed Error (Nginx)&lt;/strong&gt;
&lt;/h3&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Fix: Disable Cloudflare Proxy&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;Cloudflare Dashboard → DNS&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Find the &lt;strong&gt;CNAME record for your Jitsi domain&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;orange cloud icon&lt;/strong&gt; (proxy) and &lt;strong&gt;disable it&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Wait a few minutes, then test again&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Issue 2: Mobile Devices Can’t Access &lt;code&gt;/config.js&lt;/code&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Fix: Bypass Cloudflare Security for &lt;code&gt;/config.js&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When using Jitsi in a &lt;strong&gt;mobile application&lt;/strong&gt; (e.g., React Native or Kotlin), Cloudflare security settings might block access to &lt;code&gt;/config.js&lt;/code&gt;, preventing the app from connecting.&lt;/p&gt;

&lt;p&gt;To fix this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Go to the Cloudflare Dashboard → WAF (Firewall Rules)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create a new Custom Rule:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;If:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;http.request.uri contains "/config.js"&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Then:&lt;/strong&gt;
&lt;strong&gt;Skip&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Browser Integrity Check&lt;/li&gt;
&lt;li&gt;Bot Fight Mode&lt;/li&gt;
&lt;li&gt;Security Level&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This ensures that Jitsi’s configuration file is accessible to mobile clients.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Issue 3: Mobile Devices Can’t Join Jitsi Meetings&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Fix: Allow WebSockets in Cloudflare&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Jitsi uses &lt;strong&gt;WebSockets&lt;/strong&gt; for real-time communication. If WebSockets are blocked, mobile apps won’t be able to join meetings.&lt;/p&gt;

&lt;p&gt;To fix this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Go to the Cloudflare Dashboard → Security → WAF&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create a new Custom Rule:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;If:&lt;/strong&gt;
&lt;code&gt;URI Full equals "meet.favour.dev/xmpp-websocket"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Then:&lt;/strong&gt;
Allow WebSockets&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This allows WebSockets to pass through Cloudflare without being blocked, ensuring smooth connectivity for mobile users.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Final Steps&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;🚀 &lt;strong&gt;Your Jitsi instance is now live at &lt;code&gt;meet.&lt;/code&gt;!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;💡 If you run into problems, check logs with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```
docker-compose logs -f
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let me know if you need &lt;strong&gt;clarifications&lt;/strong&gt;!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>cloud</category>
      <category>programming</category>
    </item>
    <item>
      <title>Cryptography in JavaScript</title>
      <dc:creator>Dunsin</dc:creator>
      <pubDate>Tue, 03 Dec 2024 13:21:57 +0000</pubDate>
      <link>https://dev.to/dunsincodes/cryptography-in-javascript-a-practical-guide-1hll</link>
      <guid>https://dev.to/dunsincodes/cryptography-in-javascript-a-practical-guide-1hll</guid>
      <description>&lt;p&gt;Cryptography protects data by transforming it into a format only intended recipients can understand. It's essential for securing passwords, online transactions, and sensitive communications. Below, you'll learn about encryption, hashing, and using JavaScript to implement them.&lt;/p&gt;




&lt;h3&gt;
  
  
  What is Cryptography?
&lt;/h3&gt;

&lt;p&gt;Cryptography transforms readable data (&lt;em&gt;plaintext&lt;/em&gt;) into an unreadable format (&lt;em&gt;ciphertext&lt;/em&gt;). Only authorized parties can reverse the process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Concepts:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Encryption&lt;/strong&gt;: Converts plaintext into ciphertext.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decryption&lt;/strong&gt;: Reverses ciphertext back to plaintext using a key.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Types of Encryption
&lt;/h3&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Symmetric Encryption&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Uses the same key for encryption and decryption. The key must be shared securely between sender and receiver. AES is a widely used type of symmetric encryption algorithm  that secures data by converting it into an unreadable format. It relies on secret keys and supports 128, 192, or 256-bit key lengths, providing strong protection against unauthorized access. AES is essential for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Securing Internet Communication: Safeguarding online interactions like HTTPS.&lt;/li&gt;
&lt;li&gt;Protecting Sensitive Data: Ensuring confidentiality in storage and transmission.&lt;/li&gt;
&lt;li&gt;Encrypting Files: Keeping personal and professional information safe.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Key Elements of AES
&lt;/h4&gt;

&lt;p&gt;Key elements of AES include the &lt;strong&gt;key&lt;/strong&gt; and the &lt;strong&gt;Initialization Vector (IV)&lt;/strong&gt;. The key is a secret value shared between parties, determining how data is encrypted and decrypted, and it must always remain confidential. The IV is a random value used alongside the key to ensure that identical plaintext encrypts to different ciphertexts, adding randomness to prevent pattern recognition. While the IV can be public, it must never be reused with the same key. Together, these elements enable AES to effectively counter cyber threats, making it a cornerstone of data security.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Example: AES (Advanced Encryption Standard)&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;AES encrypts data using a shared key and an initialization vector (IV) for added randomness.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;crypto&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;algorithm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;aes-256-cbc&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randomBytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;iv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randomBytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;encrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cipher&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createCipheriv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;algorithm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;iv&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;encrypted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cipher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;encrypted&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;cipher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;final&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;encrypted&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;iv&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;iv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;decrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;encrypted&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ivHex&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;keyHex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;decipher&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createDecipheriv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;algorithm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;keyHex&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ivHex&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;decrypted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;decipher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;encrypted&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;decrypted&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;decipher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;final&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;decrypted&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Usage&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Secret Message&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;encryptedData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;encrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Encrypted:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;encryptedData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;decryptedMessage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;decrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;encryptedData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;encrypted&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;encryptedData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;iv&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;encryptedData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Decrypted:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;decryptedMessage&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. &lt;strong&gt;Asymmetric Encryption&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To create a secure encrypted system, &lt;strong&gt;asymmetric encryption&lt;/strong&gt; is often the solution. It uses two keys: a &lt;strong&gt;public key&lt;/strong&gt; for encryption and a &lt;strong&gt;private key&lt;/strong&gt; for decryption. This setup enables secure communication without sharing a single key.  &lt;/p&gt;

&lt;h4&gt;
  
  
  How It Works
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Key Pair Generation&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A public-private key pair is generated. The public key is shared openly, while the private key stays confidential.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Encryption&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The recipient's public key encrypts the data. Only their private key can decrypt it, keeping the data safe even if intercepted.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Decryption&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The recipient decrypts the data using their private key.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;crypto&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Generate keys&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;privateKey&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generateKeyPairSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;rsa&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;modulusLength&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2048&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Confidential Data&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Encrypt&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;encrypted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;publicEncrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Encrypted:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;encrypted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;base64&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="c1"&gt;// Decrypt&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;decrypted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;privateDecrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;privateKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;encrypted&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Decrypted:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;decrypted&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Hashing in Cryptography
&lt;/h3&gt;

&lt;p&gt;Hashing converts data into a fixed-length, irreversible string (hash). It's commonly used for verifying data integrity and securely storing passwords.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Popular Hashing Algorithms:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SHA-256&lt;/strong&gt;: Secure and widely used.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SHA-3&lt;/strong&gt;: Newer with enhanced security.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MD5 and SHA-1&lt;/strong&gt;: Deprecated due to vulnerabilities.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example of Hashing a String in Node.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;crypto&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;hash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createHash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sha256&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello, World!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Example output: dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Encryption vs. Hashing
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Encryption&lt;/th&gt;
&lt;th&gt;Hashing&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Process&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Two-way (encrypt/decrypt)&lt;/td&gt;
&lt;td&gt;One-way&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Data confidentiality&lt;/td&gt;
&lt;td&gt;Data integrity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Reversible&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;AES, RSA&lt;/td&gt;
&lt;td&gt;SHA-256, bcrypt&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  Practical Example: Asymmetric Encryption in Projects
&lt;/h3&gt;

&lt;p&gt;In my project &lt;a href="https://github.com/dun-sin/whisper" rel="noopener noreferrer"&gt;Whisper&lt;/a&gt;, we used asymmetric encryption to secure anonymous chat messages. Messages are encrypted with the recipient's public key, ensuring only the recipient can decrypt them using their private key.&lt;/p&gt;

&lt;p&gt;For client-side React implementation, we used &lt;code&gt;crypto-js&lt;/code&gt; for encryption and decryption:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;encoder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TextEncoder&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;encryptedMessage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;subtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RSA-OAEP&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="nx"&gt;importedPublicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;encoder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Decryption uses the private key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;decryptedMessage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;subtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RSA-OAEP&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="nx"&gt;privateKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;encryptedMessage&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explore &lt;a href="https://github.com/Dun-sin/Whisper/blob/32bbf35d299fa9d990c55f0b34bce0fe1187e542/client/src/hooks/useCryptoKeys.js" rel="noopener noreferrer"&gt;Whisper's Code&lt;/a&gt; for detailed examples.&lt;/p&gt;




&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Cryptography strengthens data security in applications. Use symmetric encryption like AES for shared-key scenarios and asymmetric encryption for public-private key systems. Hashing ensures data integrity, especially for passwords. Select the right cryptographic approach based on your application's needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Need more knowledge?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://docs.oracle.com/cd/E19047-01/sunscreen151/806-5397/i996724/index.html#:~:text=Encryption%20is%20the%20process%20by,is%20called%20the%20plaintext%20message." rel="noopener noreferrer"&gt;Read more on Shared Key&lt;/a&gt;&lt;br&gt;
&lt;a href="https://en.wikipedia.org/wiki/Public-key_cryptography" rel="noopener noreferrer"&gt;Read more on Public Key&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.simplilearn.com/tutorials/cyber-security-tutorial/sha-256-algorithm#what_is_hashing" rel="noopener noreferrer"&gt;Read more on SHA-256&lt;/a&gt;&lt;br&gt;
&lt;a href="https://xilinx.github.io/Vitis_Libraries/security/2019.2/guide_L1/internals/sha3.html" rel="noopener noreferrer"&gt;Read more on SHA-3&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.simplilearn.com/tutorials/cyber-security-tutorial/md5-algorithm" rel="noopener noreferrer"&gt;Read more on MD5&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/sha-1-hash-in-java/" rel="noopener noreferrer"&gt;Read more on SHA-1&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.ibm.com/think/topics/symmetric-encryption" rel="noopener noreferrer"&gt;Read more on Symmetric-encryption&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/advanced-encryption-standard-aes/" rel="noopener noreferrer"&gt;Read more on AES&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Thanks for reading, let me know what you think about this and if you would like to see more, if you think i made a mistake or missed something, don't hesitate to comment&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>learning</category>
    </item>
    <item>
      <title>Arrow functions in JavaScript</title>
      <dc:creator>Dunsin</dc:creator>
      <pubDate>Mon, 19 Aug 2024 08:59:19 +0000</pubDate>
      <link>https://dev.to/dunsincodes/arrow-functions-in-javascript-971</link>
      <guid>https://dev.to/dunsincodes/arrow-functions-in-javascript-971</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Arrow functions are a type of function in JavaScript that have no name which is why they are called anonymous functions and if you want them to have a name that’s callable you would have to assign them to a variable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Syntax
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Single-Line Arrow Functions
&lt;/h3&gt;

&lt;p&gt;An arrow function can just be a line of code, and in arrow functions you can omit the curly bracket and the return keyword if it’s a single line. This way of returning a value in a single line arrow function is called an &lt;strong&gt;&lt;em&gt;implicit return&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv6s59wf6wgw8ftiivvp9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv6s59wf6wgw8ftiivvp9.png" alt="Single-Link Example" width="800" height="322"&gt;&lt;/a&gt;&lt;br&gt;
if there’s a single parameter, This code snippet is a function that just returns the name. You can omit the bracket and just use the name of the parameter. &lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fso2g7vqvjhjur7anovpm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fso2g7vqvjhjur7anovpm.png" alt="Omitting bracket" width="498" height="186"&gt;&lt;/a&gt;&lt;br&gt;
If there’s no parameter, you can omit the bracket. This code doesn't require a parameter, which means you can just use the underscore symbol ( _ )&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhkf15i0wv644bkxdw7m9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhkf15i0wv644bkxdw7m9.png" alt="Using underscore" width="632" height="186"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Multi-Line Arrow Functions
&lt;/h3&gt;

&lt;p&gt;Most functions you will write will fall into this category of a multi-line arrow function. Just like a regular function, we have to use the curly brackets and the return keyword to return a value. When you use the return keyword, it’s called an &lt;strong&gt;&lt;em&gt;explicit return&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa8v6d1y6gkbj3uonebb9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa8v6d1y6gkbj3uonebb9.png" alt="Multi-line" width="784" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Comparison with Traditional Functions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Syntax Differences
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Arrow Function
&lt;/h4&gt;

&lt;h4&gt;
  
  
  In single line format
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F14vvdq3q84cqnpjxxl9h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F14vvdq3q84cqnpjxxl9h.png" alt="single line format Syntax" width="498" height="186"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  In Multi-line format
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl7p16bljxofs19kc5qsu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl7p16bljxofs19kc5qsu.png" alt="Multi-line format Syntax" width="464" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Regular Function
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fixri6oebhn1435myz06n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fixri6oebhn1435myz06n.png" alt="Regular Function Syntax" width="800" height="504"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Behaviour Differences
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Arrow functions don’t have their own context (this) so they inherit it from the part of the code they were written and not where they were called. We call this lexical scoping.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwufiql375ehawzivl8wz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwufiql375ehawzivl8wz.png" alt="code example of lexical scoping" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have two arrow functions, one defined in a regular function and the other in the object's root. The arrFunc() is undefined even if it was defined in obj. That’s because arrow functions don’t have access to th&lt;code&gt;is&lt;/code&gt; context of obj so it will look for it in the global scope and since it didn’t find a name, it returns undefined.&lt;/p&gt;

&lt;p&gt;But the arrFuncInRegFunc returns John, that’s because it’s inheriting &lt;code&gt;this&lt;/code&gt; from the function it’s defined in and not the obj. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Arrow functions don’t have their argument object, if you try to access the argument object of an arrow function it will empty&lt;/p&gt;

&lt;p&gt;Example in global scope:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpp2x1p0dvlralndy764t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpp2x1p0dvlralndy764t.png" alt="Example in global scope" width="800" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example in a regular function:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx2vob6azw0t5svhvtb2i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx2vob6azw0t5svhvtb2i.png" alt="Example in regular function" width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here the arrow function inherits the arguments object from the regular function because it doesn’t have access to its argument object&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Arrow functions cannot be used as constructors and will throw an error if used with the &lt;code&gt;new&lt;/code&gt; keyword&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmg4k731c05gqpwnfgcfi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmg4k731c05gqpwnfgcfi.png" alt="lack of new keyword code example" width="800" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example of using constructors with regular functions:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fifaj66jos53du0bpet15.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fifaj66jos53du0bpet15.png" alt="constructors in reg functions code example" width="800" height="358"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical Example
&lt;/h2&gt;

&lt;p&gt;Arrow functions are mostly used as callback functions to other functions, here are a few examples:&lt;/p&gt;

&lt;h3&gt;
  
  
  In Array Methods
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Map method&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frj6xumqeijp88ncorgui.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frj6xumqeijp88ncorgui.png" alt="Arrow function in map method" width="800" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Filter method&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdirteosz5ug4vn14ko76.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdirteosz5ug4vn14ko76.png" alt="Arrow function in filter method" width="800" height="422"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  In Event Handlers
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Femonaly8veus5ya9kgjk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Femonaly8veus5ya9kgjk.png" alt="Arrow function in event handlers" width="800" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusions
&lt;/h2&gt;

&lt;p&gt;Arrow functions were a great introduction to ES6 they allow for concise syntax because they are shorter and more compact than regular function expressions, making them easier to read and write, and also have implicit returns for single-line functions, so you don't need to use the return keyword if the value is directly after the arrow ⇾. However, if you use curly brackets, you must have a return statement or the function will return undefined.&lt;/p&gt;

&lt;p&gt;You can read more about arrow functions &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Thanks for reading, let me know what you think about this and if you would like to see more, if you think i made a mistake or missed something, don't hesitate to comment&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Everyone keeps saying to document your code, what do they actually mean</title>
      <dc:creator>Dunsin</dc:creator>
      <pubDate>Wed, 07 Aug 2024 08:28:45 +0000</pubDate>
      <link>https://dev.to/dunsincodes/everyone-keeps-saying-to-document-your-code-what-do-they-actually-mean-4fin</link>
      <guid>https://dev.to/dunsincodes/everyone-keeps-saying-to-document-your-code-what-do-they-actually-mean-4fin</guid>
      <description>&lt;p&gt;When we talk about documenting, we're not just talking about explaining every line of code using a comment. In this blog, I will be talking about what developers should do to have well documented codes. Before we get into how to document your code, let's see why it's important.&lt;/p&gt;

&lt;p&gt;Documenting your code helps other developers (and you) understand what your code does, how it works, and why you did it that way. Good documentation covers the WHAT, WHY, and HOW of your code.&lt;/p&gt;

&lt;p&gt;Now, let's talk about how to document your code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Use Git Effectively&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Many developers don't realize how much Git can help with documentation. Use commit messages to summarize what changes you made and why you made them. Avoid vague messages like "made some changes." Instead, be specific about what you did and why, include why in the Pull Request for that issue as well as tag the issue number that the code aims to solve. Proper use of Git helps track changes and makes debugging easier.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Create a Detailed README&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A well-documented README is important for anyone who needs to understand your project. It should explain what the project is about, what tools were used, how to run it, the folder structure, and versioning. Make sure the README is in the main/master branch of the project.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Write Everything Down&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The real power of documentation is in noting down as much as you can. Use a text file, Notion, or any note-taking app. For example, when you start a new project, document the libraries you install and any configuration files you set up. If you encounter errors, write them down along with their solutions. Document all features or changes you make, explaining what each feature does and why you chose your approach.&lt;/p&gt;

&lt;p&gt;In conclusion, documenting your code is very important. It helps others understand your work and helps you solve future problems. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Thanks for reading, let me know what you think about this and if you would like to see more, if you think i made a mistake or missed something, don't hesitate to comment&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>documentation</category>
      <category>programming</category>
    </item>
    <item>
      <title>Why index in programming starts from 0</title>
      <dc:creator>Dunsin</dc:creator>
      <pubDate>Mon, 29 Jul 2024 13:44:20 +0000</pubDate>
      <link>https://dev.to/dunsincodes/why-index-in-programming-starts-from-0-3jj8</link>
      <guid>https://dev.to/dunsincodes/why-index-in-programming-starts-from-0-3jj8</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Have you ever wondered why we start from 0 in programming? And no, it’s not because 0 would be lonely if we didn’t. Well, I did wonder why, so I did a little research about it. Enjoy!!&lt;/p&gt;

&lt;p&gt;We use indexing in a lot of places in programming with almost every language using it except for Lua, MATLAB etc, but it’s mostly used in data structures.&lt;/p&gt;

&lt;h2&gt;
  
  
  Historical Context
&lt;/h2&gt;

&lt;p&gt;One of the earliest programming languages, assembly language, which is a low level language. In assembly, arrays and other data structures are often accessed by calculating offsets from a base address, this means the number of positions away from the base address. The first element of an array is at the base address itself, which corresponds to an offset of 0. This naturally leads to 0-based indexing.&lt;/p&gt;

&lt;p&gt;It can be traced back to key figures and milestones that shaped its adoption. Edsger W. Dijkstra, a pioneering computer scientist, was a prominent advocate for zero-based indexing. He argued that it aligned naturally with the mathematical concept of sequences and offsets, enhancing clarity and reducing errors in programming. The milestone of the introduction of the C programming language in the early 1970s, developed by Dennis Ritchie and Brian Kernighan, was pivotal in popularizing zero-based indexing. C’s design, heavily influenced by its predecessor, B, and its system-level orientation, reinforced the efficiency and logical simplicity of starting arrays at zero. Another significant milestone was the development of assembly language, where memory addresses naturally start at zero, further justifying zero-based indexing in higher-level languages. These contributions and historical milestones collectively established zero-based indexing as a standard, influencing many subsequent programming languages and shaping modern computer science education and practices.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technical Explanation
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Memory addressing and how it relates to indexing&lt;br&gt;
When you use an array in programming, think of it like a row of lockers. Each locker has a number, starting from 0, that tells you where it is. The first locker is 0, the second is 1, and so on. This numbering system is called 0-based indexing.&lt;/p&gt;

&lt;p&gt;The reason we start counting from 0 is because of how computers handle memory. Imagine each locker is a spot in the computer's memory. The first locker (0) is exactly at the starting point of this memory space. So, when you want something from the first locker, you don’t need to move; you’re already at the right spot.&lt;/p&gt;

&lt;p&gt;This way of numbering makes it easier for the computer to find things quickly and efficiently. If you want to get something from the 3rd locker, the computer just moves 3 steps from the starting point. Starting from 0 helps everything line up perfectly with the way the computer’s memory is organized.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Comparison with one-based indexing&lt;br&gt;
One-based indexing is more intuitive for beginners because it aligns with how we typically count things in everyday life. For example, when we count people, we start with "one, two, three," not "zero, one, two." This simplicity can make it easier to understand and remember, especially for those new to programming.&lt;/p&gt;

&lt;p&gt;However, zero-based indexing offers several benefits that make it preferred in many programming languages. One key advantage is that it aligns better with memory addressing in computers. In low-level programming, arrays are often represented as blocks of memory, and the index corresponds to an offset from the start of that block. Using zero-based indexing makes these calculations more straightforward and efficient.&lt;/p&gt;

&lt;p&gt;Zero-based indexing also leads to simpler and more consistent code in certain situations. For example, when slicing arrays, it's more natural to specify the start and end indexes as 0 and the length of the slice, respectively. With one-based indexing, this would require adding or subtracting 1, introducing potential off-by-one errors.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Common Misconceptions
&lt;/h2&gt;

&lt;p&gt;One common misconception about zero-based indexing is that it is an arbitrary choice made by programming languages. Some may think that starting counting from 0 is just a convention without any deeper rationale. However, as we discussed earlier, zero-based indexing has roots in computer science and memory addressing, making it a practical choice rather than arbitrary.&lt;/p&gt;

&lt;p&gt;Another misconception is that zero-based indexing is more error-prone than one-based indexing. While it's true that off-by-one errors can occur when transitioning between zero and one-based indexing, with proper understanding and care, these errors can be minimized. In fact, some argue that zero-based indexing reduces off-by-one errors in certain scenarios, such as array slicing, compared to one-based indexing.&lt;/p&gt;

&lt;p&gt;Lastly, some may believe that zero-based indexing is less intuitive than one-based indexing, especially for beginners. While it may take some time to get used to, particularly for those new to programming, many programmers find that zero-based indexing becomes natural with practice. Understanding the rationale behind zero-based indexing can help dispel this misconception and showcase its efficiency and consistency in various programming contexts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Indexing in programming is a fundamental concept used to access elements in arrays or lists. While most languages use zero-based indexing, some languages like Lua and MATLAB use one-based indexing. Zero-based indexing has historical roots in early computer science, particularly in assembly language, where arrays are accessed by calculating offsets from a base address, starting with 0. This approach is efficient for memory addressing and aligns with how computers handle memory, making it easier to find and manipulate data.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thanks for reading, let me know what you think about this. If you think I made a mistake, missed something or want to add something, don't hesitate to comment&lt;/em&gt;&lt;/p&gt;

</description>
      <category>programming</category>
    </item>
    <item>
      <title>6 JavaScript features to improve your productivity</title>
      <dc:creator>Dunsin</dc:creator>
      <pubDate>Sun, 28 Jul 2024 12:35:15 +0000</pubDate>
      <link>https://dev.to/dunsincodes/6-javascript-features-to-improve-your-productivity-54gj</link>
      <guid>https://dev.to/dunsincodes/6-javascript-features-to-improve-your-productivity-54gj</guid>
      <description>&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Arrow Functions&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhivf8yqukfij6261n322.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhivf8yqukfij6261n322.png" alt="Arrow Function Example" width="764" height="308"&gt;&lt;/a&gt;&lt;br&gt;
Arrow functions provide a concise syntax for defining functions, reducing boilerplate code and making your code more readable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Destructuring&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqocmzf559zoaejp836qo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqocmzf559zoaejp836qo.png" alt="Destructuring Example" width="800" height="535"&gt;&lt;/a&gt;&lt;br&gt;
Destructuring enables you to extract values from objects or arrays easily, making your code cleaner and more efficient.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Template Literals&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg4ypfafw4mg9crs3uc8b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg4ypfafw4mg9crs3uc8b.png" alt="Template Literal Example" width="800" height="422"&gt;&lt;/a&gt;&lt;br&gt;
Template literals allow you to embed expressions within strings, simplifying string concatenation and enhancing readability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Default Parameters&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1r51caffxnebxzvsbc04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1r51caffxnebxzvsbc04.png" alt="Default Parameter Example" width="800" height="461"&gt;&lt;/a&gt;&lt;br&gt;
Default parameters let you provide fallback values for function parameters, reducing the need for conditional checks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Spread Operators&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0kkpmk2g6qh8igvmbtyy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0kkpmk2g6qh8igvmbtyy.png" alt="Spread Operator Example" width="800" height="431"&gt;&lt;/a&gt;&lt;br&gt;
Spread operator simplifies array manipulation, enabling you to spread elements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Map and Filter&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxclir35obon90z2eif13.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxclir35obon90z2eif13.png" alt="Map Example" width="800" height="395"&gt;&lt;/a&gt;&lt;br&gt;
Map and filter functions simplify array transformations and filtering, resulting in cleaner and more expressive code.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Finvmwvoou6b9aabreg8a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Finvmwvoou6b9aabreg8a.png" alt="Filter Example" width="800" height="360"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Thanks for reading, let me know what you think about this. If you think I made a mistake, missed something or want to add something, don't hesitate to comment&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>The Ultimate beginners guide to open source – part 4: Why you should contribute to open source projects</title>
      <dc:creator>Dunsin</dc:creator>
      <pubDate>Sun, 09 Jun 2024 11:32:20 +0000</pubDate>
      <link>https://dev.to/dunsincodes/the-ultimate-beginners-guide-to-open-source-part-4-why-you-should-contribute-to-open-source-projects-f3n</link>
      <guid>https://dev.to/dunsincodes/the-ultimate-beginners-guide-to-open-source-part-4-why-you-should-contribute-to-open-source-projects-f3n</guid>
      <description>&lt;p&gt;&lt;strong&gt;Intro&lt;/strong&gt;&lt;br&gt;
Getting involved in open source projects is a great way to improve your coding skills and work on real-world projects. By contributing to these projects, you can gain valuable experience that will make you a better developer. This blog will explore the benefits of contributing to open source, such as building your resume, connecting with other developers, and learning new technologies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Benefits&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Contributing to open source projects allows you to gain hands-on experience with real-world projects and a variety of programming languages. As you encounter and solve many code challenges, you will get practical experience that will help you become a better developer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Contributions to open source serve as real evidence of your skills. These contributions can be listed on your resume, portfolio, or LinkedIn profile, which will impress potential clients or employers and boost your chances of getting contracts or employment offers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can connect with other developers, maintainers, and industry experts. These contacts can lead to mentorship opportunities, collaboration on interesting projects, or even freelance work referrals.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open source projects come in a variety of sizes and shapes, covering a wide spectrum of technologies and tools. Participating exposes you to new libraries, frameworks, and development approaches, broadening your knowledge and keeping your skills current.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Many open-source projects have challenging problems that must be resolved. This allows you to handle hard problems, troubleshoot code, and come up with creative solutions. Such experiences can greatly improve your troubleshooting and debugging skills.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Contributing to open source is a method for developers all over the world to give back. You contribute to open-source software, making technology more accessible and enhancing it for users worldwide. This sensation of achievement can be extremely fulfilling.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You may be recognized for your contributions depending on your level of contribution. This can include badges on platforms like as GitHub, references in project documentation, or invites becoming a core contributor, all of which can help you build your reputation in the community.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Contributors from all over the world are frequently involved in open source projects. You will have the opportunity to collaborate with people from various origins, cultures, and perspectives if you participate. This global engagement has the potential to extend your horizons, strengthen your communication skills, and foster a greater understanding of global teamwork.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Thanks for reading, let me know what you think about this and if you would like to see more, if you think i made a mistake or missed something, don't hesitate to comment&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Check out &lt;a href="https://dev.to/dunsincodes/the-ultimate-beginners-guide-to-open-source-part-2ways-to-find-open-source-projects-to-contribute-to-3bkg"&gt;Part 3&lt;/a&gt; on ways to find open source projects to contribute to, &lt;a href="https://dev.to/dunsincodes/the-ultimate-beginners-guide-to-open-source-part-2-defeating-the-fear-of-contributing-1olj"&gt;Part 2&lt;/a&gt; on how to contribute to a project without feeling scared and &lt;a href="https://dev.to/dunsincodes/the-ultimate-beginners-guide-to-open-source-part-1-2la9"&gt;Part 1&lt;/a&gt; on the basics of open source.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>opensource</category>
      <category>beginners</category>
      <category>github</category>
    </item>
    <item>
      <title>The Ultimate beginners guide to open source – part 3: ways to find open source projects to contribute to</title>
      <dc:creator>Dunsin</dc:creator>
      <pubDate>Sat, 01 Jun 2024 10:06:38 +0000</pubDate>
      <link>https://dev.to/dunsincodes/the-ultimate-beginners-guide-to-open-source-part-2ways-to-find-open-source-projects-to-contribute-to-3bkg</link>
      <guid>https://dev.to/dunsincodes/the-ultimate-beginners-guide-to-open-source-part-2ways-to-find-open-source-projects-to-contribute-to-3bkg</guid>
      <description>&lt;p&gt;Most people have no idea where to look for open source projects to contribute to. In this blog, I'll discuss the methods I utilize and play around with to find projects on GitHub.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First way&lt;/strong&gt;: Go to &lt;a href="http://github.com/search" rel="noopener noreferrer"&gt;github.com/search&lt;/a&gt; to find specific repositories on GitHub. There, you can organize repositories by stars, language, forks, and most recently updated date. Simply click on the “prefixes” option in the Page to get a list of search prefixes for more advanced searches.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxqahfng1mtpkkly2ny74.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxqahfng1mtpkkly2ny74.png" alt="Image of the github search page" width="594" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This provides projects written in JavaScript, has between 300 and 1000 stars, and was last updated on September 1st, 2023. If you want to find react projects or with a keyword that isn’t a language, you can use “topic:react”.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second way&lt;/strong&gt;: You can also find projects through GitHub issues. Go to &lt;a href="http://github.com/issues" rel="noopener noreferrer"&gt;github.com/issues&lt;/a&gt; and, similar to the search function, you can filter all issues ever created on GitHub based on whether they are open, have a specified label, and the language they are written in.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
input the following: is:open is:issue archived:false label:Hacktoberfest language:typescript -author:[your-github-username]&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwr0xhc9wwlrbrbr2bh1m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwr0xhc9wwlrbrbr2bh1m.png" alt="Image of example of all issues" width="550" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Third way&lt;/strong&gt;: go to &lt;a href="http://github.com/" rel="noopener noreferrer"&gt;github.com&lt;/a&gt;, click on filter, and then select repositories and recommendations. GitHub will recommend repositories that they think you will be interested in. If you also select repository activity, you will be able to see what the people you follow on GitHub are contributing to, and you can then check out those projects.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fefk33zktuyyp31iw0vl5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fefk33zktuyyp31iw0vl5.png" alt="Github home page with the filters in place" width="584" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Thanks for reading, let me know what you think about this and if you would like to see more, if you think i made a mistake or missed something, don't hesitate to comment&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check out &lt;a href="https://dev.to/dunsincodes/the-ultimate-beginners-guide-to-open-source-part-2-defeating-the-fear-of-contributing-1olj"&gt;Part 2&lt;/a&gt; on how to contribute to a project without feeling scared and &lt;a href="https://dev.to/dunsincodes/the-ultimate-beginners-guide-to-open-source-part-1-2la9"&gt;Part 1&lt;/a&gt; on the basics of open source.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>opensource</category>
      <category>learning</category>
    </item>
    <item>
      <title>The Ultimate beginners guide to open source – Part 2: Defeating the fear of contributing</title>
      <dc:creator>Dunsin</dc:creator>
      <pubDate>Thu, 30 May 2024 14:23:15 +0000</pubDate>
      <link>https://dev.to/dunsincodes/the-ultimate-beginners-guide-to-open-source-part-2-defeating-the-fear-of-contributing-1olj</link>
      <guid>https://dev.to/dunsincodes/the-ultimate-beginners-guide-to-open-source-part-2-defeating-the-fear-of-contributing-1olj</guid>
      <description>&lt;p&gt;Contributing and finding repositories to contribute to is scary. If you are one of those people, I have a hack for you that is sure to help you overcome that fear.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick a project you want to contribute to, click on the “watch” button.&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjndgkegl5d12r5enij9y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjndgkegl5d12r5enij9y.png" alt="Project top bar" width="800" height="107"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkqk3h0gqy9bl1mcjm2ag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkqk3h0gqy9bl1mcjm2ag.png" alt="Dropdown for the watch button" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;strong&gt;_custom _&lt;/strong&gt; and pick the following: issues, pull request (optional) and discussions (optional).&lt;/p&gt;

&lt;p&gt;This allows you to get notifications on any issue, pull request or discussion created in the project. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here’s what you should do with every type of notification you get:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Issue: When you get an issue notification and you are interested in solving that issue, you will be among the first to view it and decide if you want to work on it, but what if you don't know how to work on that issue? &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can wait until it's allocated to someone else and then ask that person if you can collaborate; you'll make &lt;em&gt;a new friend, learn, and have someone lead you through how the project works&lt;/em&gt;. Believe me, the open source software community is really kind.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Pull Request: You can review other people's work and that teaches you how to read code, which is a really useful ability to have as a programmer. You also get to view the corrections/suggestions that the maintainers have made to the code, which shows you the project's code practices and a better way of solving and doing things.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Discussion: You get to talk to people, ask/answer questions, and discuss the next steps needed for the project. This also gets you friends, and you get to network and better share your expertise on the knowledge you have.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The goal of picking a project to contribute to isn't to try to participate right away; instead, you should familiarize yourself with the project.&lt;/p&gt;

&lt;p&gt;Another little tip if you are just starting with open source is to not contribute to big projects, go with projects with 20–1000 stars.&lt;/p&gt;

&lt;p&gt;Looking for a project to practice? Try this &lt;a href="https://github.com/dun-sin/code-magic" rel="noopener noreferrer"&gt;Practice Project&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;See you in part 3 and check out &lt;a href="https://dev.to/dunsincodes/the-ultimate-beginners-guide-to-open-source-part-1-2la9"&gt;part 1 here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Thanks for reading, let me know what you think about this and if you would like to see more, if you think i made a mistake or missed something, don't hesitate to comment&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>The Ultimate beginners guide to open source – part 1</title>
      <dc:creator>Dunsin</dc:creator>
      <pubDate>Wed, 29 May 2024 13:38:49 +0000</pubDate>
      <link>https://dev.to/dunsincodes/the-ultimate-beginners-guide-to-open-source-part-1-2la9</link>
      <guid>https://dev.to/dunsincodes/the-ultimate-beginners-guide-to-open-source-part-1-2la9</guid>
      <description>&lt;p&gt;An open source project is one where the source code is visible to everyone and where developers are welcome to contribute. React(made by facebook), WordPress, and Node.js are two instances of open source projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;People who engage in open source projects include the following:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Owner&lt;/strong&gt;: Who created or launched the initiative; this could be a company or a person.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contributor&lt;/strong&gt;: A person who asks for changes to the project in order to improve it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintainer&lt;/strong&gt;: Someone who makes decisions for the project, such as whether a pull request is acceptable or an issue is valid, and who generates ideas; this is most frequently a contributor and the owner.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Users&lt;/strong&gt;: This group of individuals that use the project, as the name implies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Myths in Open source:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You must be familiar with every tool used: If a project uses React, Redux, and Tailwind it you can know react and just redux, you can contribute with what you know until you master the rest.&lt;/li&gt;
&lt;li&gt;You must be a programmer: You can contribute to design and documentation without having any programming experience.&lt;/li&gt;
&lt;li&gt;You must be an expert: There is always something you can contribute to the project, regardless of the degree of your expertise.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Ways to contribute to a project:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fix a bug you found&lt;/li&gt;
&lt;li&gt;Read the documentation and if anything is confusing, help improve it&lt;/li&gt;
&lt;li&gt;Propose a feature you want added&lt;/li&gt;
&lt;li&gt;Help improve the design&lt;/li&gt;
&lt;li&gt;Translate the documentation to your language&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How to contribute to a project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Fork the project&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz2q2gzc3vgkmqifjpc7q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz2q2gzc3vgkmqifjpc7q.png" alt="Image of the fork button" width="524" height="30"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Read the readme file&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvyqrasksxy1vq9mdziem.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvyqrasksxy1vq9mdziem.png" alt="Example of what the readme file looks like" width="593" height="48"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use the project by going to the url or downloading the app and suggest improvement, this gives you first hand experience on what users may need as you're putting yourself in their shoes&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Favak32o004g9yris54ld.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Favak32o004g9yris54ld.png" alt="Screenshot of where to find the projects link" width="265" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Look at existing issues and see what you can work on.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Looking for a project to practice try this &lt;a href="https://github.com/dun-sin/code-magic" rel="noopener noreferrer"&gt;Practice Project&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Thanks for reading, let me know what you think about this and if you would like to see more, if you think i made a mistake or missed something, don't hesitate to comment&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/dunsincodes/the-ultimate-beginners-guide-to-open-source-part-2-defeating-the-fear-of-contributing-1olj"&gt;check out part 2&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>opensource</category>
      <category>career</category>
      <category>development</category>
    </item>
  </channel>
</rss>
