Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Selectable checksum algorithms and exposing the checksum in the output pattern #49

Open
dkasak opened this issue Dec 14, 2017 · 1 comment

Comments

@dkasak
Copy link

dkasak commented Dec 14, 2017

It would be nice if the checksum algorithm radamsa uses internally for test case deduplication was selectable.

As aoh told me on IRC, radamsa uses a custom 96-bit checksum for the uniqueness filter (i.e. deduplication). At first it used SHA256 for this purpose but it was replaced with a simpler and leaner stream algorithm due to better performance and memory usage. However, in certain workflows, one may want truly unique files so it makes sense to spend a bit more resources to calculate a better quality hash (e.g. SHA256).

Additionally, if this is implemented, it would be nice if the checksum was exposed as an output pattern specifier (e.g. %h for hash, or whatever), since it would allow files generated by radamsa to be automatically deduplicated at the filesystem level. This integrates nicely into workflows that use the same strategy to ensure test case uniqueness in a corpus.

@aoh
Copy link
Owner

aoh commented Dec 17, 2017

First part done. Hash function can be selected with -H, and sha256 is converted internally to suitable 3-byte chunks for storing in hash tree, so the old checksum store can be used also for them. The checksum is currently shown in metadata, but not available for use in file name yet.

sol:~/src/radamsa$ ./bin/radamsa -H sha256 -M - -o out rad/*
seed: 828407099649152197717268
muta-num: 1, source: "rad/mutations.scm", generator: file, checksum: "a1b7541834709043aa7355dc89d8c6fdfd4115a18f64f5728b27aa63782b731a", nth: 1, path: "out", output: file-writer, length: 48645, pattern: once-dec
sol:~/src/radamsa$ sha256sum out
a1b7541834709043aa7355dc89d8c6fdfd4115a18f64f5728b27aa63782b731a  out

GerHobbelt pushed a commit to GerHobbelt/radamsa that referenced this issue Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants