-->

ABOUT US

Our development agency is committed to providing you the best service.

OUR TEAM

The awesome people behind our brand ... and their life motto.

  • Kumar Atul Jaiswal

    Ethical Hacker

    Hacking is a Speed of Innovation And Technology with Romance.

  • Kumar Atul Jaiswal

    CEO Of Hacking Truth

    Loopholes are every major Security,Just need to Understand it well.

  • Kumar Atul Jaiswal

    Web Developer

    Techonology is the best way to Change Everything, like Mindset Goal.

OUR SKILLS

We pride ourselves with strong, flexible and top notch skills.

Marketing

Development 90%
Design 80%
Marketing 70%

Websites

Development 90%
Design 80%
Marketing 70%

PR

Development 90%
Design 80%
Marketing 70%

ACHIEVEMENTS

We help our clients integrate, analyze, and use their data to improve their business.

150

GREAT PROJECTS

300

HAPPY CLIENTS

650

COFFEES DRUNK

1568

FACEBOOK LIKES

STRATEGY & CREATIVITY

Phasellus iaculis dolor nec urna nullam. Vivamus mattis blandit porttitor nullam.

PORTFOLIO

We pride ourselves on bringing a fresh perspective and effective marketing to each project.

  • Best Practices for Handling Local Images in React Applications

     

    Best Practices for Handling Local Images in React Applications

     

    Step-by-Step Guide to Using Images with import.meta.url in React

     

    Hello viewers, i am back again for you and now we will start from reactjs. So, we are ready for implemenation Best Practices for Handling Local Images in React Applications and set result. Actually we are making some project like E-commerce where we can implement react rating start.

     

     

    React


    Certainly, Reactjs is a JavaScript library developed by Facenook for building user interfaces. It allows developers to create reusable UI components and effciently manage the state of their applications. Here are some key aspects of Reactjs.

     

     

    import.meta.url



    When building React applications, working with static assets like images is a common requirement. In this article, we’ll walk through how to efficiently import and display images using import.meta.url, which is especially useful in modern JavaScript and frameworks like Vite.



    What is import.meta.url?



    import.meta.url provides the absolute URL of the current module. It’s a feature introduced in ES modules to handle module-related metadata. In the context of React and tools like Vite, it’s often used for dynamically importing static assets like images.



    Why Use import.meta.url for Images?



    # It ensures proper resolution of local images at runtime.
    # It’s ideal for bundlers like Vite, where traditional require() or relative paths might not work as expected.
    # It provides a clean and scalable way to manage static assets in your project.

     

     

    Step-by-Step Guide



    1. Create the Image Component

    We’ll create a file named Image.jsx to define our static images and use import.meta.url for dynamic URL resolution.

    Image.jsx

     

     

    // Image.jsx
    const IMAGES = {
        image1: new URL('./google-logo.png', import.meta.url).href
    };
    
    export default IMAGES;
    
    

     

     

     

    Here’s what’s happening:


    # The new URL() constructor dynamically resolves the image path relative to the module using import.meta.url.
    # .href provides the URL as a string for use in the src attribute of the <img> tag.



    2. Create the Image Display Component

    Now, we’ll create another component called GetImage.jsx to display the image.

     

     

     

    // GetImage.jsx
    import React from 'react';
    import IMAGES from './images/Image';
    
    function GetImage() {
      return (
        <div/>
          <div/>
            <img src={IMAGES.image1} alt="Google Logo" />
          </div/>
        </div/>
      );
    }
    
    export default GetImage;
    
    
    

     

     

    Here’s what this does:


    # The IMAGES object imported from Image.jsx provides the resolved URL of the image.
    # The <img> tag uses the resolved URL from IMAGES.image1 to display the image.



    3. Add the Image to Your Project


    Make sure the google-logo.png image is placed in the correct folder (./images/ in this case) relative to Image.jsx.


    Best Practices for Handling Local Images in React Applications



    Best Practices for Handling Local Images in React Applications




    # Benefits of This Approach

    # Dynamic Resolution: Using import.meta.url ensures that paths are resolved dynamically, reducing potential errors.
    # Scalability: Centralizing image URLs in one file (Image.jsx) makes it easy to manage and update images.
    # Compatibility: Works seamlessly with modern bundlers like Vite.



    Common Mistakes to Avoid



    # Incorrect Relative Paths: Ensure the image file is located correctly relative to Image.jsx.

     

     

     

     


    # Install redux and saga packages - CLICK HERE

    # Make reducer wrapper - CLICK HERE

    # Action in reducer - CLICK HERE

    # Reducer in redux - CLICK HERE

    # Switch Stmt in redux - CLICK HERE

    # Get data in component from redux - CLICK HERE 

    # Remove from cart - CLICK HERE 

    # Add Redux Toolkit in react redux saga - CLICK HERE  

    # Configure MiddleWare saga - CLICK HERE   

    # Call API with Saga and Set Result in react redux saga - CLICK HERE    

    # Product list ui with API data in react redux saga - CLICK HERE    

    # Remove to Cart with ID react redux saga - CLICK HERE     

    # Add Routing and Make Cart Page - CLICK HERE   

    # Show Added To Cart Product with Price Calculation  - CLICK HERE  

     

    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

     


  • How to Access Your ReactJS Vite App on Another Device Within the Same Network

     

    Access your reactjs app on another device within the same network

     

    Access your reactjs app on another device within the same network


    Certainly, Reactjs is a JavaScript library developed by Facenook for building user interfaces. It allows developers to create reusable UI components and effciently manage the state of their applications. Here are some key aspects of Reactjs.

    Now we will run a ReactJS Vite app hosted on localhost:5173 on another laptop within the same network, but you need to make a few adjustments like this -




    Steps to Access the Vite App on Another Laptop:

     

    1) Ensure Both Devices Are on the Same Network:

    Both laptops should be connected to the same Wi-Fi or local area network (LAN).


    2) Find the Host Laptop's IP Address

     
     

    On Windows:

     

    Open Command Prompt and type: ipconfig
    Look for the IPv4 address under your active network connection.
            
    On macOS/Linux:
    Open the terminal and type: ifconfig or ip addr
    Find the IP address of the active network interface.


    3) Run the Vite App

    Start your Vite development server by running npm run dev (or yarn dev) on the host laptop.



    4) Update the URL

    Instead of localhost:5173, use the host laptop's IP address with port 5173. For example:

        
    http://<HOST_LAPTOP_IP>:5173


    Replace <HOST_LAPTOP_IP> with the actual IP address, like 192.168.1.10:5173.



    5) Allow Connections Through Firewall (If Necessary)

    On Windows:
    Search for "Windows Defender Firewall" > "Allow an app or feature through Windows Defender Firewall."
    Ensure your development environment (e.g., Node.js) is allowed for both private and public networks.


     

    On macOS/Linux:

     

    Ensure the firewall (if enabled) allows incoming connections on port 5173.

    Access the App on Another Laptop
    Open a browser on the second laptop and type the IP-based URL (e.g., http://192.168.1.10:5173).



    Notes:


    If you're using Vite's default configuration, it binds the server to localhost. To make it accessible to other devices, you may need to modify the vite.config.js:


    Restart the server after making this change.

      
      
    
    export default {
      server: {
        host: '0.0.0.0', // Allows connections from other devices
        port: 5173,
      },
    }; 
     





    Access your reactjs app on another device within the same network


    Access your reactjs app on another device within the same network




    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     






  • Understanding push and pop Methods

     

    Understanding push and pop Methods

     

     "Mastering JavaScript Arrays: Understanding push() and pop() Methods"

     

    Arrays are one of the most versatile and commonly used data structures in JavaScript. Two frequently used methods for manipulating arrays are push() and pop(). In this article, we’ll dive deep into these methods, their use cases, and clarify some common misconceptions.

     
    Overview of push() and pop()
     

    # push() Method:


    # Adds one or more elements to the end of an array.
    # Returns the new length of the array.



    Syntax:


    array.push(element1, element2, ..., elementN);




    Example:

     

    const arr = [];
    arr.push(1); // Adds 1 to the array
    arr.push(2); // Adds 2 to the array
    console.log(arr); // Output: [1, 2]
    
    
    
    



    pop() Method:


    # Removes the last element from an array.
    # Returns the removed element. If the array is empty, it returns undefined.

     

    Syntax:

    array.pop();



    Example:

     

    const arr = [1, 2];
    const removed = arr.pop(); // Removes the last element (2)
    console.log(arr); // Output: [1]
    console.log(removed); // Output: 2
    
    
    

     

     

    Breaking Down the Code


    Here’s the code example in question:

     

     

    const arr = [];
    arr.push(1); // Adds 1 to the array
    arr.push(2); // Adds 2 to the array
    arr.pop(2);  // Removes the last element, but the argument (2) is ignored
    console.log(arr);
    
    
    
    

     
    Explanation:


    # arr.push(1) and arr.push(2) add 1 and 2 to the array, resulting in [1, 2].
    # arr.pop(2) removes the last element (2). However, the argument passed to pop() (2) is ignored because pop() does not accept any arguments.
    # After the pop() operation, the array becomes [1].



     

    Understanding push and pop Methods

     

     

     

    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

     

  • Understanding JavaScript substring(): Common Pitfalls and Examples

     


     

    Understanding JavaScript substring():

     

    The JavaScript substring() method is a powerful tool for extracting parts of a string. However, its behavior can sometimes be confusing for beginners. This article will help you understand how substring() works, its quirks, and common mistakes you should avoid.




    What is the substring() Method?



    The substring() method in JavaScript extracts a portion of a string and returns it as a new string without modifying the original string. It takes two arguments:

    # Start index: The position where the extraction begins (inclusive).
    # End index: The position where the extraction ends (exclusive).


    string.substring(startIndex, endIndex)


    If the endIndex is omitted, the method extracts the rest of the string starting from startIndex.

     

     

    Example Usage


    Let’s look at some basic examples:

     

    let x = "Learn"
    console.log(x.substring(5, 1))
    
    console.log("kumaratuljaiswal.in");
    

     

     

     


     

    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

     

  • How setTimeout Uses Closures with var and let

     

    How setTimeout Uses Closures with var and let

     

     How setTimeout Uses Closures with var and let 


     
    This blog we have seen javascript  closure wtih setTimeout and  solve let and var issue wtih forloop basic and how is it work, we have already seen some Javscript,  mongodb basic, CRUD operation, connect mongodb with nodejs, read, update, delete, POST, GET API etc. we should not face any problem while making Database, collection(table) and using the data in nodejs even whenever we will make API. Read data from mongodb in nodejs



    • # What is Closure with setTimeout
    • # Solve for loop issue wtih let and var using closure concept

     

     

    What is Closure ?

     

    A closure is created when a function remember its lexical scope even when its executed outside the scope. In other terms we can say that a closure give a function access to variable from its surrounding environment. 

     

     

    Don't worry i will give you an example - Suppose that you have a backpack with your notes, pens and books etc. You leave the classroom (your outer function), but you still have access to everything in your backpack (your closures). Whenever you need to solve a problem later, you can pull out the knowledge you saved in your backpack.

     

     

    function makeAdder(x) {
      return function(y) {
        return x + y;
      };
    }
    
    const add5 = makeAdder(5);
    const add10 = makeAdder(10);
    
    console.log(add5(2)); // 7
    console.log(add10(2)); // 12
    

     

     

    Here in this code makeAdder function takes a single argument x and return a new function.

    The return function takes a single argument  and return the sum of x and y.

    add5 and add10 are closures that maintain their own separate lexical environment , holding the value of x from when they were created 

     

     

    Example : A Basic Closure

     

     

    function outerfunction() {
       const outerVariable = 'Hello, Atul';
    
    
       function innerFunction() {
         console.log(outerVariable);
       }
    
       return innerFunction() {
    }
    
    const myClosure = outerFunction();
    myClosure();        //output: 'Hello, Atul'
    
    
    
    

     


    What's Happening Here?

    # innerFunction is returned from outerFunction.

    # Even though outerFunction has finished executing, innerFunction still remembers outerVariable.

    # A function is defined inside another function.

    # The inner function "remembers" the variables of the outer function.



    How setTimeout Uses Closures:

     # Inner Function: When you pass a function to setTimeout, that function forms a closure. It "remembers" the variables and values from the scope where it was created.
     

    # Delayed Execution: setTimeout schedules the function to be executed after a specified delay. But even after the surrounding code has finished running, the inner function (callback) still has access to its original scope's variables.

     

     

    for(var i=0; i< 10; i++)
    {
        setTimeout(function(){
            console.log(i)
        })
    }
    
    

     

     

    in this code why always showing output 10, 10, 10...

    The reason the code logs 10 repeatedly is due to how closures work in JavaScript. When the setTimeout callback executes, it accesses the value of i from the surrounding scope (the loop). By the time the callbacks execute, the loop has already finished, and i is equal to 10 for all of them. 

     

     

    How setTimeout Uses Closures with var and let

     

     

     


    Explanation:

     

    # The var keyword declares i in the function scope (or global scope if not inside a function). This means all iterations of the loop share the same i variable.

    # The setTimeout function schedules the callback to execute after a certain delay, but the loop doesn't wait for the callbacks to execute—it continues running to completion.

    # By the time the callbacks from setTimeout are executed, the loop has already completed, and the value of i has reached 10.

     

     Fix: Using let


    The easiest way to fix this issue is to use the let keyword instead of var. Variables declared with let have block scope, so each iteration of the loop gets its own copy of i.

     A function is defined inside another function.

    The inner function "remembers" the variables of the outer function.

     

    for (let i = 0; i < 10; i++) {
        setTimeout(function () {
            console.log(i);
        }, 0);
    }
    
    
    

     

     

    Here, each i is scoped to its specific iteration, so the output will correctly log 0, 1, 2, ..., 9.

     

     

     

    How setTimeout Uses Closures with var and let

     

    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

     


  • Breaking It Down JWT Authentication

     

    Breaking It Down JWT Authentication

     

     Breaking It Down JWT Authentication

     

    JWT (JSON web token) authentication is a widely used method for securely transmitting information between parties as a JSON object. It is a token-based approach often employed in web applications for authentication and authorization purposes. 

     

    How JWT Works

     

    1) Token creation: When a user logs in or registers, the server creates a token (JWT) that contains encoded information (claims) such as user ID or roles. This token is signed (often using  a secret key or a public/private key) to ensure its integrity.

     

     2) Token Structure: A JWT consists of three parts:

     

    i) Header: Contains information about the token type (JWT) and the signing algorithm (eg: HMAC SHA256).

    ii) Payload: Contains the claims (user data and metadata)

    iii) Signature: Created using the header, payload, and a secret key.

     

     

     Benefits of JWT for Registration Authentication

     

    i) Stateless: JWTs enable stateless authentication, meaning the server doesn't need to store user session data. All information is encoded in the token, making it lightweight and scalable.

    ii) Security: JWTs are signed, so can't be tempered and without invalidating the signature.

    iii) Easy to Use: JWTs are easy to create and vaidate, making them ideal for handling user registration, email verification, OTP verification and more.

     

     

    Breaking it Down

     

     

     

    eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkF0dWwgS3VtYXIiLCJlbWFpbCI6Imt1bWFyYXR1bGphaXN3YWwyMjJAZ21haWwuY29tIiwiaWF0IjoxNTE2MjM5MDIyfQ.YOdnmqIgD7L2PU0xHpGVzL_-tgiktaWk17hAIm__bC0
    

     

     

     A JWT (JSON web token) is a base64-encoded string that consists of three parts. Header, Payload, and signature, separated by dots (.) . Here's an example of what a JWT look like after a user registers:


    1] Header: Encoded metadata about the token



    {
      "alg": "HS256",
      "typ": "JWT"
    }
    



    alg: Algorithm used for signing (Eg. HS256 for HMAC SHA-256).

    typ: Token type (always JWT)


    Encoded as Base64:


    eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
    



    2] Payload: Contains claims or user-related data.



    {
      "sub": "1234567890",
      "name": "Atul Kumar",
      "email": "kumaratuljaiswal222@gmail.com",
      "iat": 1516239022
    }
    



    userId: A unique identifier for the user (Eg: database ID)

    name: User's name

    email: User's email address

    iat: Issued At Time (UNIX timestamp of when the token was created)


    Encoded as Base64:

     

     

    eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkF0dWwgS3VtYXIiLCJlbWFpbCI6Imt1bWFyYXR1bGphaXN3YWwyMjJAZ21haWwuY29tIiwiaWF0IjoxNTE2MjM5MDIyfQ
    

     

     

    3] Signature: Ensures the token's integrity, Created using the encoded header, encoded payload, and a secret key (eg: mysecretkey).

     

     


    HMACSHA256(
      base64UrlEncode(header) + "." +
      base64UrlEncode(payload),
      secret
    )
    
    


     The result:


     

    YOdnmqIgD7L2PU0xHpGVzL_-tgiktaWk17hAIm__bC0
    

     

     

     Full JWT Structure:


    [Header].[Payload].[Signature]

     

     

    JWT Auth Code  


    Link - https://github.com/whoiskumaratul/jwt-authentication.git

     


    Notes:



    Readable Information: The Header and Payload are Base64-encoded and can be decoded to see the content. This is why sensitive data (e.g., passwords) should never be included in a JWT.

    Signature Security: The Signature ensures the token hasn't been tampered with. Without the secret key, an attacker cannot forge a valid token.

    Expiration:
    Typically, JWTs also include an expiration (exp) claim to ensure the token is valid only for a certain time frame.

    Adding an expiration claim example to the payload:

     

     

    {
      "sub": "1234567890",
      "name": "Atul Kumar",
      "email": "kumaratuljaiswal222@gmail.com",
      "iat": 1516239022
      "exp": 1689692100
    }
    
    

     

     

     This JWT would expire in 1 hour (if iat is 1516239022 and exp is 1689692100).

     

     

     


     

    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

     

  • Submit a new Singapore Tax Form for adsense

     

    Submit a new Singapore Tax Form for adsense

     

     

    Submitting a new Singapore Tax Form for AdSense involves updating your tax information in your Google AdSense account to comply with Singapore tax regulations. Here’s a step-by-step guide on how to do it:



    ### Step-by-Step Guide to Submit a New Singapore Tax Form for Google AdSense:

    1. **Log in to Your AdSense Account**  
       - Go to [Google AdSense](https://www.google.com/adsense/) and log in using your account credentials.

     

     

    Submit a new Singapore Tax Form for adsense

     

     



    2. **Access the Payments Section**  
       - Once logged in, click on the **Payments** tab in the left-hand menu.
       - In the Payments section, look for **Manage settings**  and click on it.

     

     

    Submit a new Singapore Tax Form for adsense

     

     



    3. **Navigate to the Tax Information Section**  
       - Scroll down to the **Payments profile** section, where you’ll find an option for **United States tax info**.
       - Click on **Manage tax info** to proceed.

     



    4. **Update or Add New Tax Information**  
       - You will see your existing tax documents if you have any. To add a new tax form, click on the **Add tax info** button.
       - You’ll be asked to re-authenticate with your Google account password.

     

     

    Submit a new Singapore Tax Form for adsense

     



    5. **Choose the Appropriate Tax Form**  
       - Google AdSense will guide you to select the appropriate tax form based on your account type (individual or business).
     


    Submit a new Singapore Tax Form for adsense



    Submit a new Singapore Tax Form for adsense


     
     

    Submit a new Singapore Tax Form for adsense



     

    As a bussiness type choose and establishment in singapore simply select NO option.



    Submit a new Singapore Tax Form for adsense





    6. **Provide Your Tax Details**  
       - Sinapore Goods and Services Tax (GST) click for this  NO.
       - leave UEN number as a blank 
       - Tax exemtpions  : you are eligible and click on YES option.



    Submit a new Singapore Tax Form for adsense



    7. **Tax Residency**  
       - Region/country : choose your country .
       - Proof of tax residency - For this first you need to select Other document and then upload your Pan Card or Aadhaar card.   
     

     

     

    Submit a new Singapore Tax Form for adsense

     

    8. **Expiry Date**  
       - You better know there is no expiry date for aadhaar card or pan card.
     

     

    Submit a new Singapore Tax Form for adsense

     

     

     


    9. **Certify and Submit the Form**  
       - Review the information you’ve provided, then check the certification box to confirm that the details are accurate.
       - Click on **Submit** to complete the process.

     

     

    Submit a new Singapore Tax Form for adsense

     


    10. **Confirmation and Review**  
       - Once submitted, you’ll receive a confirmation email from Google AdSense regarding the tax information submission.
       - Your payment may be subject to tax withholding based on the information you provided.



    after 12-24 hours I got the mail....







    By following these steps, you can successfully submit or update your Singapore Tax Form for Google AdSense and ensure that your account is compliant with tax regulations.

     

     

     Disclaimer



    The information provided on this blog is for general informational purposes only and is not intended to be a substitute for professional tax advice. While we strive to ensure the accuracy and completeness of the information presented, we make no guarantees regarding its accuracy, applicability, or completeness.

    Tax regulations and procedures may vary based on your individual circumstances and may change over time. It is strongly recommended to consult with a qualified tax professional or refer directly to official government sources for specific guidance related to submitting a Singapore Tax Form for Google AdSense.

    By using this information, you acknowledge that you are doing so at your own risk, and the blog owner shall not be held liable for any errors, omissions, or any loss or damage arising from the use of the information provided.

  • WHAT WE DO

    We've been developing corporate tailored services for clients for 30 years.

    CONTACT US

    For enquiries you can contact us in several different ways. Contact details are below.

    Hacking Truth.in

    • Street :Road Street 00
    • Person :Person
    • Phone :+045 123 755 755
    • Country :POLAND
    • Email :contact@heaven.com

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.