Files
zkldi_Tachi/docs/docs/codebase/implementation-details/goal-id.md
T
Katie 3fa1a22714 docs: Fix a lot of random typos and formatting issues (#1245)
This is far from perfect (or everything), but in theory provides a better experience.
2025-02-24 21:06:35 +00:00

19 lines
568 B
Markdown

# Goal ID implementation
Goal IDs exist to dedupe goals when a user creates
a new goal. For example, if a user wants to create a
HARD CLEAR Mei goal, but one already exists, we should
not insert two [Goal Documents](../../schemas/goal.md)
representing the same thing.
*****
## Hashing
To create the Goal ID, we perform a [JSON stable hash](https://github.com/zkrising/fast-json-stable-hash) on the
`game`, `playtype`, `charts` and `criteria` of this field.
This enforces that goals are unique on those fields.
The above hash is then returned, prefixed with `G`.