Hashes in JSON output are not deterministically ordered

Open
#165 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
cli

Research direction

Start in the tools-java code path that serializes SPDX package hashes to JSON, using an SPDX document with multiple hashes to reproduce the varying order. Trace how hashes are collected and emitted, then confirm that repeated JSON output is deterministic and check whether the same concern applies to other output formats.

Written by the indexing model from the issue text.

Description

bug

When I create an SPDX document with multiple hashes on a package, the order of the hashes in the output json varies.

The hashes should follow a deterministic ordering.

Please let us know whether we shall prepare an PR for this. Perhaps it must be generalized to other output formats as well to produce comparable outputs.

Regards,
Karsten

Dominant language
Java
Stars
101
Forks
46
Avg merge
9h 43m
Merged PRs (30d)
8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from spdx/tools-java

All issues in spdx/tools-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.