{
  "schemaVersion": 1,
  "slug": "brine-calculator",
  "category": "cooking",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "0271f9aa5a77b8f2491f189cce574419a73d67415383503e61e82fac0e0bbda4",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/brine-calculator.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": "Salt = 10·V·p_s; Sugar = 10·V·p_u",
    "vars": [
      [
        "Salt",
        "Salt, g"
      ],
      [
        "Sugar",
        "Sugar, g"
      ],
      [
        "V",
        "Water volume, L"
      ],
      [
        "p_s",
        "Salt concentration, %"
      ],
      [
        "p_u",
        "Sugar concentration, %"
      ]
    ],
    "note": "Percentages as entered (5 = 5%): 5 g ingredient per 100 mL water. This page calculates ingredient amounts only; it does not estimate safe brining time or food safety."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const ml=waterLitres*1000;const salt=ml*saltPercent/100;const sugar=ml*sugarPercent/100;if(!Number.isFinite(ml)||ml<=0||meatKg<0)return{saltGrams:null,sugarGrams:null,saltPerKg:null,__error:'inputError'};return{saltGrams:salt,sugarGrams:sugar,saltPerKg:meatKg>0?salt/meatKg:null};",
    "inputs": [
      {
        "name": "waterLitres",
        "type": "number",
        "default": 4,
        "min": 0,
        "max": 200,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "saltPercent",
        "type": "number",
        "default": 5,
        "min": 0.5,
        "max": 20,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "sugarPercent",
        "type": "number",
        "default": 2,
        "min": 0,
        "max": 20,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "meatKg",
        "type": "number",
        "default": 2,
        "min": 0,
        "max": 50,
        "step": 0.1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "saltGrams",
        "precision": 0,
        "unit": "g"
      },
      {
        "name": "sugarGrams",
        "precision": 0,
        "unit": "g"
      },
      {
        "name": "saltPerKg",
        "precision": 1,
        "unit": "g/kg",
        "optional": true
      }
    ],
    "interpret": null
  }
}
