Support XXH and other performant hash algorithms
- Dominant language
- Go
- Stars
- 9.6k
- Forks
- 954
- Avg merge
- 23h 27m
- Merged PRs (30d)
- 48
Description
Today we support hashing sources as well as files within sources, which is all configurable:
```yaml
# .syft.yaml
file:
metadata:
# the file digest algorithms to use when cataloging files (options: "md5", "sha1", "sha224", "sha256", "sha384", "sha512") (env: SYFT_FILE_METADATA_DIGESTS)
digests:
- 'sha1'
- 'sha256'
source:
file:
# the file digest algorithms to use on the scanned file (options: "md5", "sha1", "sha224", "sha256", "sha384", "sha512") (env: SYFT_SOURCE_FILE_DIGESTS)
digests:
- 'SHA-256'
```
We should add more performant algorithms such as XXH64 (insert more here, open to suggestions!).
Contributor guide
Research direction
Start by tracing the file.metadata.digests and source.file.digests configuration, including SYFT_FILE_METADATA_DIGESTS and SYFT_SOURCE_FILE_DIGESTS, to find their validation and hashing entry points. Determine which performant algorithms are in scope and how they should be exposed; done means both source and file hashing accept the agreed algorithms without breaking existing options, with corresponding tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100