Skip to content

Instantly share code, notes, and snippets.

@richardlehane
Created October 21, 2015 04:37
Show Gist options
  • Save richardlehane/91f6bc23cff146c1c70a to your computer and use it in GitHub Desktop.
Save richardlehane/91f6bc23cff146c1c70a to your computer and use it in GitHub Desktop.
// PREPARATORY CHANGES TO SF
1. Use existing -hash flag but change behaviour so can accept a comma separated list of hashes e.g. -hash md5,ssdeep
2. change hash.go file (under /cmd/) so that checksum var is a slice of hashes var checksum []hash.Hash
3. writer interface (cmd/writers.go) updated so writeFile method takes a slice of byte slices for checksum digests (checksum [][]byte)
And all writers (JSON, CSV, YAML etc) updated so they can accept multiple checksum digests.
4. in cmd/sf.go update the identifyRdr func so it ranges through the slice of checksums, calculating for each, and returns a slice of byte slices for checksum digests
// SQLITEANALYSIS CHANGES
5. copy the hash.go flag as hash_sqliteanalysis.go and prepend build tag
6. add spamspam as an import and update the functions in this file
May need to add a SpamHash type that wraps SpamSpamWriter // type SpamHash struct {SpamSpamWriter}.
This will allow overriding the Sum method so that it returns content of the SpamSpamWriter String() method as a byte slice, rather than existing Sum method which doesn't seem to give expected result.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment