{
  "schemaVersion": 1,
  "slug": "hashtag-generator",
  "category": "social-media",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "ba70a36f8ea7e77670e0b3d29f4ed76641275599e40976f332fcab2df88c227a",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/hashtag-generator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "H = seededShuffle(topicPool)[1…min(k, |P|)]",
    "vars": [
      [
        "P",
        "Candidate tag pool built from topic and platform"
      ],
      [
        "seed",
        "Random seed"
      ],
      [
        "k",
        "Number of hashtags requested"
      ],
      [
        "H",
        "Selected hashtags"
      ]
    ],
    "note": "A seeded shuffle selects up to k tags from a topic-specific candidate pool. Unicode letters and numbers are retained. No live trend or engagement data is used."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const rng = (s) => { let a = Math.floor(s) >>> 0; return () => { a = (a + 0x6D2B79F5) >>> 0; let t = a; t = Math.imul(t ^ (t >>> 15), t | 1); t ^= t + Math.imul(t ^ (t >>> 7), t | 61); return ((t ^ (t >>> 14)) >>> 0)/4294967296; }; }; const clean = String(topic).normalize('NFKC').toLowerCase().replace(/[^\\p{L}\\p{N} ]/gu, ' ').trim(); const words = clean.split(/\\s+/u).filter(Boolean); if (!words.length) return { hashtags:null, hashtagCount:null, broadTags:null, nicheTags:null, characterCount:null, __error:'inputError' }; const joined = words.join(''); const broad = ['#'+joined, '#'+joined+'tips', '#'+joined+'guide', '#'+joined+'ideas', '#'+joined+'community', '#'+joined+'daily', '#'+joined+'inspiration']; const prefixes = { instagram:['reels','instadaily','ig'], tiktok:['fyp','foryou','tiktok'], twitter:['x','now','thread'], youtube:['shorts','youtube','video'] }[niche] || ['daily']; const nicheTags = [...new Set(words.flatMap(w=>['#'+w,'#'+w+'tips']))]; for (const p of prefixes) nicheTags.push('#'+p+joined); const pool = [...new Set(broad.concat(nicheTags))]; const arr = pool.slice(); const r = rng(seed); for (let i=arr.length-1;i>0;i--) { const j=Math.floor(r()*(i+1)); [arr[i],arr[j]]=[arr[j],arr[i]]; } const chosen=arr.slice(0,Math.min(count,arr.length)); return { hashtags:chosen.join(' '),hashtagCount:chosen.length,broadTags:broad.join(' '),nicheTags:nicheTags.slice(0,8).join(' '),characterCount:chosen.join(' ').length };",
    "inputs": [
      {
        "name": "topic",
        "type": "text",
        "default": "sourdough baking",
        "step": 1
      },
      {
        "name": "count",
        "type": "number",
        "default": 15,
        "min": 1,
        "max": 60,
        "step": 1,
        "slider": true
      },
      {
        "name": "niche",
        "type": "select",
        "default": "instagram",
        "options": [
          {
            "value": "instagram"
          },
          {
            "value": "tiktok"
          },
          {
            "value": "twitter"
          },
          {
            "value": "youtube"
          }
        ]
      },
      {
        "name": "seed",
        "type": "number",
        "default": 2026,
        "min": 0,
        "max": 1000000,
        "step": 1
      }
    ],
    "outputs": [
      {
        "name": "hashtags",
        "precision": 0,
        "unit": "",
        "type": "text",
        "display": "tokens",
        "separator": " "
      },
      {
        "name": "hashtagCount",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "broadTags",
        "precision": 0,
        "unit": "",
        "type": "text",
        "display": "tokens",
        "separator": " "
      },
      {
        "name": "nicheTags",
        "precision": 0,
        "unit": "",
        "type": "text",
        "display": "tokens",
        "separator": " "
      },
      {
        "name": "characterCount",
        "precision": 0,
        "unit": ""
      }
    ],
    "interpret": null
  }
}
