Menu

1 / 2

Our activation code bans I and O, and the prefix in front of it is NTFIO

DEV Community: typescript·Daniel Pertu·5 days ago
#krEXzedv
#devtotypescript#devto#dev#email#code
Reading 0:00
15s threshold

Notifio is a desktop app that watches rental search pages and tells you about new listings. It is sold as a one-time licence rather than a subscription, so there are no accounts, no passwords and no sign-in on the website at all. After checkout the server emails an activation code, and you type your email plus that code into the app on first launch.

That code is the entire credential. Here is all of the code that makes one:

import crypto from " crypto " ;

/** * Generates a human-readable activation token: NTFIO-XXXX-XXXX-XXXX * where X is an uppercase alphanumeric character (no ambiguous chars like O/0, I/1). */ const ALPHABET = " ABCDEFGHJKLMNPQRSTUVWXYZ23456789 " ;

function randomSegment ( length : number ): string { const bytes = crypto . randomBytes ( length ); return Array . from ( bytes ) . map (( b ) => ALPHABET [ b % ALPHABET . length ]) .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.