Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add md5() function to snapshot #190

Merged
merged 3 commits into from
Jan 28, 2024
Merged

Add md5() function to snapshot #190

merged 3 commits into from
Jan 28, 2024

Conversation

lukfor
Copy link
Collaborator

@lukfor lukfor commented Jan 28, 2024

This PR adds the function md5() to snapshots that allow to store the hashsum instead of the content in the snapshot file. This fixes #175.

def content = [
  object1: "lukas",
  object2: 27,
  object3: [
      a: "lll",
      b: [1,2,3,4,5,6]
  ]
]

assert snapshot(content).match("snapshot1")
assert snapshot(content).md5().match("snapshot2")

Snapshot:

{
    "snapshot1": {
        "content": [
            {
                "object1": "lukas",
                "object2": 27,
                "object3": {
                    "a": "lll",
                    "b": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6
                    ]
                }
            }
        ],
        "timestamp": "2024-01-28T11:41:29.018819"
    },
    "snapshot2": {
        "content": "a54d97026c5ed6e6a57ccd3a3f5a3cbc",
        "timestamp": "2024-01-28T11:41:29.025981"
    }
}

@lukfor lukfor merged commit ab4f138 into main Jan 28, 2024
12 checks passed
@lukfor lukfor deleted the features/snapshot-md5 branch January 28, 2024 14:16
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

md5sums rather than literal content of partial gzipped files
1 participant