<?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: AltRepo</title>
    <description>The latest articles on DEV Community by AltRepo (@altrepo).</description>
    <link>https://dev.to/altrepo</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%2F3983178%2F170d58cd-8ad9-4036-972b-ec31d61e1e98.png</url>
      <title>DEV Community: AltRepo</title>
      <link>https://dev.to/altrepo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/altrepo"/>
    <language>en</language>
    <item>
      <title>I Built the Same Hash Utility for Browser, Node, and Python</title>
      <dc:creator>AltRepo</dc:creator>
      <pubDate>Sun, 14 Jun 2026 08:51:03 +0000</pubDate>
      <link>https://dev.to/altrepo/i-built-the-same-hash-utility-for-browser-node-and-python-1546</link>
      <guid>https://dev.to/altrepo/i-built-the-same-hash-utility-for-browser-node-and-python-1546</guid>
      <description>&lt;p&gt;Hashing text is easy until you try to make the same workflow feel clean across different environments.&lt;/p&gt;

&lt;p&gt;In the browser, you usually reach for the Web Crypto API. For files, that means working with File or Blob objects and reading them as ArrayBuffer.&lt;/p&gt;

&lt;p&gt;In Node, file hashing usually means streams and the built-in crypto module.&lt;/p&gt;

&lt;p&gt;In Python, the same job usually goes through hashlib.&lt;/p&gt;

&lt;p&gt;None of that is complicated on its own. The annoying part is that the APIs are different enough that you end up rewriting the same small helpers over and over.&lt;/p&gt;

&lt;p&gt;That is why I made a small set of AltRepo hash utilities.&lt;/p&gt;

&lt;p&gt;For the browser, I have a local-first hash tool:&lt;/p&gt;

&lt;p&gt;AltRepo Text Hash Generator&lt;/p&gt;

&lt;p&gt;For JavaScript projects, I published:&lt;/p&gt;

&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/altrepo"&gt;@altrepo&lt;/a&gt;/hash on npm&lt;/p&gt;

&lt;p&gt;For Python scripts, I published:&lt;/p&gt;

&lt;p&gt;altrepo-hash on PyPI&lt;/p&gt;

&lt;p&gt;The goal is simple: hash text, bytes, browser files, Node files, and Python files with a small predictable API.&lt;/p&gt;

&lt;p&gt;The browser version is useful when you just want to paste text and get a checksum without installing anything.&lt;/p&gt;

&lt;p&gt;The npm package is useful when you want the same kind of helper inside a JavaScript or TypeScript project.&lt;/p&gt;

&lt;p&gt;The Python package is useful for scripts, automation, and checksum verification.&lt;/p&gt;

&lt;p&gt;I also kept the packages small. The Python package uses the standard library. The JavaScript package separates browser and Node behavior so browser code does not pull in Node-only file APIs.&lt;/p&gt;

&lt;p&gt;That part matters because browser hashing and Node hashing are similar in purpose, but they are not the same implementation.&lt;/p&gt;

&lt;p&gt;Browser example:&lt;/p&gt;

&lt;p&gt;import { hashText } from "&lt;a class="mentioned-user" href="https://dev.to/altrepo"&gt;@altrepo&lt;/a&gt;/hash";&lt;/p&gt;

&lt;p&gt;const digest = await hashText("hello", "SHA-256");&lt;br&gt;
console.log(digest);&lt;/p&gt;

&lt;p&gt;Node file hashing uses the Node entry point:&lt;/p&gt;

&lt;p&gt;import { hashFile } from "&lt;a class="mentioned-user" href="https://dev.to/altrepo"&gt;@altrepo&lt;/a&gt;/hash/node";&lt;/p&gt;

&lt;p&gt;const digest = await hashFile("archive.zip", "sha256");&lt;br&gt;
console.log(digest);&lt;/p&gt;

&lt;p&gt;Python example:&lt;/p&gt;

&lt;p&gt;from altrepo_hash import hash_text&lt;/p&gt;

&lt;p&gt;print(hash_text("hello", algorithm="sha256"))&lt;/p&gt;

&lt;p&gt;I also made a couple of small examples here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/AltRepoYT/altrepo-hash" rel="noopener noreferrer"&gt;GitHub hash repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/AltRepoYT/altrepo-hash-js" rel="noopener noreferrer"&gt;JavaScript hash repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gist.github.com/AltRepoYT/adf110edea152d5986d50c36a600df4f" rel="noopener noreferrer"&gt;Browser file hash Gist&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The bigger idea behind AltRepo is to keep small utilities practical. Some tasks need a server. Hashing text or checking a local file usually does not.&lt;br&gt;
More AltRepo developer packages and demos:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://altrepo.net/packages/" rel="noopener noreferrer"&gt;AltRepo Developer Packages&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>python</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
