Name Compatibility Hash Test: The Formula Behind the Score

PublishedToolLove Tester by Name

Contents
  1. Why deterministic calculation matters
  2. How the name hash compatibility score is calculated
  3. Key points
  4. Wrap-up
  5. Frequently asked questions

When you want to check name compatibility for fun with a partner, someone you're talking to, or a close friend, a scoring method that pulls numbers from plain randomness (Math.random) gives you a different result every time you enter the same names, so it's hard to trust. Love Tester by Name runs both names through a deterministic hash algorithm so that the same pair of names always produces the same compatibility score and couple-trait analysis. This post walks through how the score is calculated, step by step.

Summary ① It builds an integer hash from the Unicode values of the combined name string. ② It takes the absolute value of the hash, divides by 61, and adds 40 to the remainder, converting it into a compatibility score between 40 and 100. Because the calculation is deterministic, the same pair of names always gives the same result. ③ Using the tool runs this calculation for you and also shows the couple-trait analysis and tailored tips.

Why deterministic calculation matters

A scoring method that draws numbers from a random function like Math.random() gives a different result every time you enter the same names. For content like name compatibility that people check repeatedly, screenshot, and share, the same input has to produce the same result so users can trust it and come back. That's why this approach calculates the score with a hash function built on the Unicode values of the name strings.

How the name hash compatibility score is calculated

Turning two names into a deterministic score comes down to three steps.

Calculation steps

  1. Sort and combine the names: So that swapping the order of the two names gives the same result, sort both names alphabetically and then join them into a single string.
  2. Compute the polynomial rolling hash: Walk through the combined string one character at a time and repeatedly apply the rule "hash = hash × 31 + Unicode value of the current character" to produce a single integer hash value.
  3. Normalize the score: Take the absolute value of the hash, divide by 61, and add 40 to the remainder to convert it into a compatibility score between 40 and 100.

Here's the JavaScript code that implements the process exactly. Enter the same two names and it always returns the same score.

function calculateLoveScore(name1, name2) {
  // 1. Trim whitespace, normalize to lowercase, sort the names
  const clean1 = name1.trim().toLowerCase();
  const clean2 = name2.trim().toLowerCase();
  const combined = [clean1, clean2].sort().join('&');

  // 2. 31 polynomial hash
  let hash = 0;
  for (let i = 0; i < combined.length; i++) {
    const charCode = combined.charCodeAt(i);
    hash = (hash * 31 + charCode) & 0xffffffff; // Lock to 32-bit integer range (sign preserved, absolute value handled at the end)
  }

  // 3. Produce a compatibility score adjusted to the 40% ~ 100% range
  const baseScore = 40 + (Math.abs(hash) % 61);
  return baseScore;
}

// Example usage
console.log(calculateLoveScore("김철수", "이영희")); // Same input always returns the same value (78)

Note The calculation above is designed to lift even the lowest score to 40% or higher, so results always land in the positive 40 ~ 100% range. It's also common to compute and output tailored tips that help each of you cover what the other lacks.

If you'd rather skip writing the code yourself or following the math by hand and just enter two names to see the result right away, check it with our tool.

Love Tester by Name

Enter two names and get a fun compatibility score from a deterministic letter hash, plus a tailored report.

Key points

ItemDetails
AlgorithmPolynomial rolling hash (hash × 31 + character Unicode value)
Order sensitivitySame result regardless of name order (calculated after sorting alphabetically)
Score rangeAbsolute value of the hash mod 61, plus 40, adjusted to 40 ~ 100
ReproducibilityThe same pair of names always gives the same score, no matter how many times you recalculate

Wrap-up

Love Tester by Name doesn't use random values. It builds the score with a polynomial hash calculation over the Unicode values of the name strings. It sorts the two names, computes the hash, then takes the absolute value, divides by 61, and adds 40 to convert it into a score between 40 and 100, so the result is always the same no matter what order you enter the names. You can calculate it in code yourself, but it's simpler to use the tool: just enter the names and you get the score and couple-trait analysis right away.

Love Tester by Name

Enter two names and get a fun compatibility score from a deterministic letter hash, plus a tailored report.

Frequently asked questions

Does the result change if I enter the names in a different order?

No. The tester sorts the pair of names before running the hash, so the compatibility score for "A and B" and the score for "B and A" always come out the same.

Does the compatibility score guarantee real relationship chemistry?

No. This tool is entertainment content that turns name strings into a score via hashing. It isn't a scientific way to judge real romantic compatibility or personality fit.

Will the score change if I enter the same pair of names again?

No. Because it uses a deterministic hash algorithm, the same two names always produce the same score and analysis, no matter how many times you recalculate.

This article was adapted from our Korean original. Read the Korean original

Related articles

  1. Lucky Color & Lucky Item Matching: Formula and Birthday GuideSee how a birthday or zodiac sign and today's date become a daily lucky color, item, number, and direction, with the formula and JavaScript code.
  2. MBTI Compatibility Chart: How 16x16 Matrix Grades Are CalculatedSee how the MBTI compatibility chart's 16x16 matrix assigns grades. We explain the scoring order, the 16 ideal pairs, and every other rule.
  3. Mystery MBTI Guessing Game: Guess MBTI From 10 ScenariosHow each of the 10 behavior scenarios points to one MBTI type, how to compare clues on the E-I, S-N, T-F and J-P axes, and how the scoring works.
  4. WPM and CPM Formula: How Typing Speed and Accuracy WorkSee exactly how WPM, CPM, and accuracy are calculated in a typing game, try the formulas yourself, and check your speed in Mini Typing Racer.
  5. Dice Doubles Probability Formula and 40-Space Board SimulationSee why doubles hit 6/36 (16.67%), how three doubles in a row send you to jail, and how (position + sum) mod 40 moves a token around 40 spaces.
  6. Check Your Public IP Address: Location, ISP, and Browser InfoSee how public and private IPs differ, how NAT works, and how to look up your public IP, approximate location, ISP, and browser details.

Related tools