<?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: Rajesh Pabbu</title>
    <description>The latest articles on DEV Community by Rajesh Pabbu (@rajeshpabbu).</description>
    <link>https://dev.to/rajeshpabbu</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%2F350071%2F80cf068e-9daa-4b3f-842e-c6769da60a50.jpeg</url>
      <title>DEV Community: Rajesh Pabbu</title>
      <link>https://dev.to/rajeshpabbu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rajeshpabbu"/>
    <language>en</language>
    <item>
      <title>Image Compressor npm</title>
      <dc:creator>Rajesh Pabbu</dc:creator>
      <pubDate>Thu, 24 Oct 2024 01:09:18 +0000</pubDate>
      <link>https://dev.to/rajeshpabbu/image-compressor-npm-3510</link>
      <guid>https://dev.to/rajeshpabbu/image-compressor-npm-3510</guid>
      <description>&lt;p&gt;&lt;a href="https://www.npmjs.com/package/browser-image-compression" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/browser-image-compression&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://lostintokyo.co.uk/about/test-image-7mb-2/" rel="noopener noreferrer"&gt;https://lostintokyo.co.uk/about/test-image-7mb-2/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://sample-videos.com/download-sample-jpg-image.php" rel="noopener noreferrer"&gt;https://sample-videos.com/download-sample-jpg-image.php&lt;/a&gt;&lt;br&gt;
&lt;a href="https://2016.robocup.org/web/index-84.html" rel="noopener noreferrer"&gt;https://2016.robocup.org/web/index-84.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://examplefile.com/image/jpg/5-mb-jpg" rel="noopener noreferrer"&gt;https://examplefile.com/image/jpg/5-mb-jpg&lt;/a&gt;&lt;br&gt;
&lt;a href="https://commons.wikimedia.org/wiki/File:Snake_River_(5mb).jpg" rel="noopener noreferrer"&gt;https://commons.wikimedia.org/wiki/File:Snake_River_(5mb).jpg&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Client Side - Compute the SHA-256 hash of a file that is selected in a file input</title>
      <dc:creator>Rajesh Pabbu</dc:creator>
      <pubDate>Fri, 11 Oct 2024 13:23:43 +0000</pubDate>
      <link>https://dev.to/rajeshpabbu/client-side-compute-the-sha-256-hash-of-a-file-that-is-selected-in-a-file-input-5730</link>
      <guid>https://dev.to/rajeshpabbu/client-side-compute-the-sha-256-hash-of-a-file-that-is-selected-in-a-file-input-5730</guid>
      <description>&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;html&amp;gt;&lt;br&gt;
  &amp;lt;body&amp;gt;&lt;br&gt;
    &amp;lt;input type="file" id="myfile" onchange="onMyfileChange(this)" /&amp;gt;&lt;br&gt;
    &amp;lt;script type="text/javascript"&amp;gt;&lt;br&gt;
      function onMyfileChange(fileInput) {&lt;br&gt;
        if (fileInput.files[0] == undefined) {&lt;br&gt;
          return;&lt;br&gt;
        }&lt;br&gt;
        var filename = fileInput.files[0].name;&lt;br&gt;
        // var filesize = fileInput.files[0].size;&lt;br&gt;
        var reader = new FileReader();&lt;br&gt;
        reader.onload = function (ev) {&lt;br&gt;
          console.log('File', filename, ':');&lt;br&gt;
          //&lt;br&gt;
          crypto.subtle&lt;br&gt;
            .digest('SHA-256', ev.target.result)&lt;br&gt;
            .then((hashBuffer) =&amp;gt; {&lt;br&gt;
              // Convert hex to hash, see https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest#converting_a_digest_to_a_hex_string&lt;br&gt;
              const hashArray = Array.from(new Uint8Array(hashBuffer));&lt;br&gt;
              const hashHex = hashArray&lt;br&gt;
                .map((b) =&amp;gt; b.toString(16).padStart(2, '0'))&lt;br&gt;
                .join(''); // convert bytes to hex string&lt;br&gt;
              console.log(hashHex);&lt;br&gt;
            })&lt;br&gt;
            .catch((ex) =&amp;gt; console.error(ex));&lt;br&gt;
        };&lt;br&gt;
        reader.onerror = function (err) {&lt;br&gt;
          console.error('Failed to read file', err);&lt;br&gt;
        };&lt;br&gt;
        reader.readAsArrayBuffer(fileInput.files[0]);&lt;br&gt;
      }&lt;br&gt;
    &amp;lt;/script&amp;gt;&lt;br&gt;
  &amp;lt;/body&amp;gt;&lt;br&gt;
&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://stackblitz.com/edit/vitejs-vite-9xawha?file=index.html" rel="noopener noreferrer"&gt;https://stackblitz.com/edit/vitejs-vite-9xawha?file=index.html&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  References: Thank you all for the below
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://emn178.github.io/online-tools/sha256_checksum.html" rel="noopener noreferrer"&gt;https://emn178.github.io/online-tools/sha256_checksum.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://hash-file.online/" rel="noopener noreferrer"&gt;https://hash-file.online/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://emn178.github.io/online-tools/sha256_checksum.html" rel="noopener noreferrer"&gt;https://emn178.github.io/online-tools/sha256_checksum.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://hash.online-convert.com/sha256-generator" rel="noopener noreferrer"&gt;https://hash.online-convert.com/sha256-generator&lt;/a&gt;&lt;br&gt;
&lt;a href="https://techoverflow.net/2021/11/26/how-to-compute-sha-hash-of-local-file-in-javascript-using-subtlecrypto-api/" rel="noopener noreferrer"&gt;https://techoverflow.net/2021/11/26/how-to-compute-sha-hash-of-local-file-in-javascript-using-subtlecrypto-api/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://gist.github.com/miguelmota/6bae57a971676f570a767dbd12ca4c55/revisions" rel="noopener noreferrer"&gt;https://gist.github.com/miguelmota/6bae57a971676f570a767dbd12ca4c55/revisions&lt;/a&gt;&lt;br&gt;
&lt;a href="https://ilikekillnerds.com/2020/04/how-to-get-the-hash-of-a-file-in-node-js/" rel="noopener noreferrer"&gt;https://ilikekillnerds.com/2020/04/how-to-get-the-hash-of-a-file-in-node-js/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Interview Preparation</title>
      <dc:creator>Rajesh Pabbu</dc:creator>
      <pubDate>Wed, 03 Jul 2024 05:48:39 +0000</pubDate>
      <link>https://dev.to/rajeshpabbu/interview-preparation-3dnc</link>
      <guid>https://dev.to/rajeshpabbu/interview-preparation-3dnc</guid>
      <description>&lt;p&gt;&lt;a href="https://dev.to/letstechtalks/100-most-asked-javascript-interview-questions-and-answers-part-1-443o#3-whats-the-difference-between-undefined-and-null-in-javascript"&gt;https://dev.to/letstechtalks/100-most-asked-javascript-interview-questions-and-answers-part-1-443o#3-whats-the-difference-between-undefined-and-null-in-javascript&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/macmacky/70-javascript-interview-questions-5gfi#the-questions"&gt;https://dev.to/macmacky/70-javascript-interview-questions-5gfi#the-questions&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
