Skip to content

Commit

Permalink
chore: Improve readability of SHA256 python example
Browse files Browse the repository at this point in the history
  • Loading branch information
tazarov committed Jul 16, 2024
1 parent c5338d4 commit 044e5c6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/core/document-ids.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ thing, as it allows you to change the document without changing the ID.
```

=== "Python"

**Random SHA256:**

```python
import hashlib
Expand Down Expand Up @@ -194,6 +196,8 @@ thing, as it allows you to change the document without changing the ID.
collection.add(ids=[generate_sha256_hash() for _ in range(len(my_documents))], documents=my_documents)
```

**Document-based SHA256:**

It is also possible to use the document as basis for the hash, the downside of that is that when the document changes,
and you have a semantic around the text as relating to the hash, you may need to update the hash.

Expand Down

0 comments on commit 044e5c6

Please sign in to comment.