901 private links
Yes, it's another chat over documents implementation... but this one is entirely local!
This article shows you how to set up .onion website with a custom domain for localhost on the dark web. Why would someone want to host their website on the dark web? The reasons could be anything from hosting a private site and keeping others’ eyes away from it to showcasing a site to friends to demonstrate its coolness.
Tool: cathuggermkp224o vanity address generator for tor onion v3 (ed25519) hidden services
Infinite Mac is a collection of classic Macintosh and NeXT system releases and software, all easily accessible from the comfort of a (modern) web browser.
Pick any version of System Software/Mac OS or NeXTStep/OPENSTEP from the 1980s or 1990s and run it (and major software of that era) within a virtual machine. You can also run a custom version with your choice of machine and virtual disks. Files can be imported and exported using drag and drop, and System 7 and onward have more advanced integrations as well – refer to the welcome screen in each machine for more details.
The SHA-256 algorithm is a widely used hash function producing a 256-bit hash value. It is used in many security applications and protocols, including TLS and SSL, SSH, PGP, and Bitcoin.
Calculating a SHA-256 hash in JavaScript is easy using native APIs, but there are some differences between the browser and Node.js. As the browser implementation is asynchronous, both of the examples provided will return a Promise
for consistency.
Browser
In the browser, you can use the SubtleCrypto API to create a hash for the given value. You first need to create a new TextEncoder
and use it to encode the given value. Then, pass its value to SubtleCrypto.digest()
to generate a digest of the given data, resulting in a Promise
.
As the promise resolves to an ArrayBuffer
, you will need to read the data using DataView.prototype.getUint32()
. Then, you need to convert the data to its hexadecimal representation using Number.prototype.toString()
. Add the data to an array using Array.prototype.push()
. Finally, use Array.prototype.join()
to combine values in the array of hexes
into a string.
const hashValue = val =>
crypto.subtle
.digest('SHA-256', new TextEncoder('utf-8').encode(val))
.then(h => {
let hexes = [],
view = new DataView(h);
for (let i = 0; i < view.byteLength; i += 4)
hexes.push(('00000000' + view.getUint32(i).toString(16)).slice(-8));
return hexes.join('');
});
hashValue(
JSON.stringify({ a: 'a', b: [1, 2, 3, 4], foo: { c: 'bar' } })
).then(console.log);
// '04aa106279f5977f59f9067fa9712afc4aedc6f5862a8defc34552d8c7206393'
Node.js
In Node.js, you can use the crypto
module to create a hash for the given value. You first need to create a Hash
object with the appropriate algorithm using crypto.createHash()
. Then, use hash.update()
to add the data from val
to the Hash
and hash.digest()
to calculate the digest of the data.
For consistency with the browser implementation and to prevent blocking on a long operation, we'll return a Promise
by wrapping it in setTimeout()
.
import { createHash } from 'crypto';
const hashValue = val =>
new Promise(resolve =>
setTimeout(
() => resolve(createHash('sha256').update(val).digest('hex')),
0
)
);
hashValue(JSON.stringify({ a: 'a', b: [1, 2, 3, 4], foo: { c: 'bar' } })).then(
console.log
);
// '04aa106279f5977f59f9067fa9712afc4aedc6f5862a8defc34552d8c7206393'
Notes
- The two implementations are not compatible with each other. You cannot use the browser implementation in Node.js and vice versa.
- Both implementations should produce the same result for the same input.
By now I’m sure you’ve heard of DuckDuckGo around the web (and I’ve been mentioning them for years). If you don’t already have the scoop, it’s the search engine that can serve as a complete replacement for Google (and Bing and whatever else you like), except it respects your privacy and security. And while Google does some cool tricks, DuckDuckGo does some even better ones.
Recipes, Calculator, Code snippets, Cheat sheets, Calendar, Search for HTML characters, xkcd, Emoji/emoticons, Social handles, Is it raining, Weather, Generate a password or pass phrase, Shorten URLs, Lipsum, URL Encoding, Stopwatch/timer, Figlet…
Most things that you can do manually in the browser can be done using Puppeteer! Here are a few examples to get you started:
Generate screenshots and PDFs of pages.
Crawl a SPA (Single-Page Application) and generate pre-rendered content (i.e. "SSR" (Server-Side Rendering)).
Automate form submission, UI testing, keyboard input, etc.
Create an up-to-date, automated testing environment. Run your tests directly in the latest version of Chrome using the latest JavaScript and browser features.
Capture a timeline trace of your site to help diagnose performance issues.
Test Chrome Extensions.