Menu

Same input, different output: I audited my own generator — and here's the whole app on one page
📰

Same input, different output: I audited my own generator — and here's the whole app on one page

DEV Community: javascript·Melisa Wong·9 days ago
#Ghsd1FcO
#devtojavascript#devto#dev#name#const
Long article (1958 words) — no AI summary yet.
Reading 0:00
15s threshold

I have a generator that turns one input — your name — into a Chinese name, a past life, a guardian beast, a set of real places, and a fortune for the day. Last week I asked it a question I should have asked in month one:

If two devices, same input, same day, each run this thing, do they get the same answer?

I was confident the answer was yes. I even have a function named hashNameDate . Then I grepped my own source and wrote a 200,000-trial test against my own code, and found three places where the answer is no. What follows is what the product is (in one page, so any feedback has something to bite on), the three findings with the measurements, the twenty lines that fix them, and three questions I genuinely can't answer from the inside.

The whole thing, on one page

You type your name. You get a Chinese name drawn from real history, in one of six styles: poetic, bold, rooted in the five elements, drawn from nature, a transliteration of how your name sounds, or rustic folk.…

Continue reading — create a free account

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