{
  "description": "Test vectors locking SHA-256 v2 hashing over UTF-8 bytes for non-ASCII unit keys.",
  "bundle": "bundle_unicode.json",
  "testCases": [
    {
      "name": "ascii_baseline",
      "context": {
        "userId": "user-abc"
      },
      "expectedHashing": {
        "layer_ui": {
          "bucket": 177
        },
        "layer_pricing": {
          "bucket": 902
        }
      },
      "expectedAssignments": {
        "ui.primaryColor": "#0000FF",
        "pricing.discount": 10,
        "feature.flag": false
      },
      "comment": "SHA-256 v2 over UTF-8 bytes of the unit key. Locks cross-language byte hashing."
    },
    {
      "name": "japanese",
      "context": {
        "userId": "ユーザー"
      },
      "expectedHashing": {
        "layer_ui": {
          "bucket": 693
        },
        "layer_pricing": {
          "bucket": 929
        }
      },
      "expectedAssignments": {
        "ui.primaryColor": "#FF0000",
        "pricing.discount": 10,
        "feature.flag": false
      },
      "comment": "SHA-256 v2 over UTF-8 bytes of the unit key. Locks cross-language byte hashing."
    },
    {
      "name": "emoji",
      "context": {
        "userId": "user-🚀-42"
      },
      "expectedHashing": {
        "layer_ui": {
          "bucket": 771
        },
        "layer_pricing": {
          "bucket": 366
        }
      },
      "expectedAssignments": {
        "ui.primaryColor": "#FF0000",
        "pricing.discount": 0,
        "feature.flag": true
      },
      "comment": "SHA-256 v2 over UTF-8 bytes of the unit key. Locks cross-language byte hashing."
    },
    {
      "name": "cyrillic",
      "context": {
        "userId": "пользователь"
      },
      "expectedHashing": {
        "layer_ui": {
          "bucket": 436
        },
        "layer_pricing": {
          "bucket": 478
        }
      },
      "expectedAssignments": {
        "ui.primaryColor": "#0000FF",
        "pricing.discount": 0,
        "feature.flag": true
      },
      "comment": "SHA-256 v2 over UTF-8 bytes of the unit key. Locks cross-language byte hashing."
    },
    {
      "name": "arabic",
      "context": {
        "userId": "مستخدم"
      },
      "expectedHashing": {
        "layer_ui": {
          "bucket": 454
        },
        "layer_pricing": {
          "bucket": 261
        }
      },
      "expectedAssignments": {
        "ui.primaryColor": "#0000FF",
        "pricing.discount": 0,
        "feature.flag": true
      },
      "comment": "SHA-256 v2 over UTF-8 bytes of the unit key. Locks cross-language byte hashing."
    },
    {
      "name": "mixed_cjk_latin",
      "context": {
        "userId": "用户-alice"
      },
      "expectedHashing": {
        "layer_ui": {
          "bucket": 538
        },
        "layer_pricing": {
          "bucket": 384
        }
      },
      "expectedAssignments": {
        "ui.primaryColor": "#FF0000",
        "pricing.discount": 0,
        "feature.flag": true
      },
      "comment": "SHA-256 v2 over UTF-8 bytes of the unit key. Locks cross-language byte hashing."
    },
    {
      "name": "non_ascii_layer_id_ascii_user",
      "context": {
        "userId": "user-abc"
      },
      "expectedHashing": {
        "layer_ui": {
          "bucket": 177
        },
        "layer_naïve_日本_🎉": {
          "bucket": 121,
          "comment": "SHA-256 v2 hash of the framed input. Locks UTF-8 byte-length framing of a non-ASCII layer id."
        }
      },
      "expectedAssignments": {
        "ui.primaryColor": "#0000FF",
        "pricing.discount": 10,
        "feature.flag": false
      },
      "comment": "ASCII unit key with a non-ASCII layer id. The layer length is framed in UTF-8 bytes."
    },
    {
      "name": "non_ascii_layer_id_non_ascii_user",
      "context": {
        "userId": "ユーザー"
      },
      "expectedHashing": {
        "layer_naïve_日本_🎉": {
          "bucket": 338,
          "comment": "SHA-256 v2 hash of the framed input. Both unit key and layer id are non-ASCII; both lengths are framed in UTF-8 bytes."
        }
      },
      "expectedAssignments": {
        "ui.primaryColor": "#FF0000",
        "pricing.discount": 10,
        "feature.flag": false
      },
      "comment": "Non-ASCII unit key AND non-ASCII layer id. Locks cross-language UTF-8 byte framing of both fields."
    }
  ]
}
