Skip to content

fingerprint attribute in VirtualCodebase - #15

Closed
pratik0316 wants to merge 1 commit into
aboutcode-org:mainfrom
pratik0316:fingerprint
Closed

fingerprint attribute in VirtualCodebase #15
pratik0316 wants to merge 1 commit into
aboutcode-org:mainfrom
pratik0316:fingerprint

Conversation

@pratik0316

Copy link
Copy Markdown
Contributor

Signed-off-by: Pratik Dey pratikrocks.dey11@gmail.com

Issue: #12

Virtual Codebase can now scan for files having fingerprint Attribute within it
gentle ping : @MaJuRG @pombredanne

Signed-off-by: Pratik Dey <pratikrocks.dey11@gmail.com>

@steven-esser steven-esser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, @pombredanne am I missing anything here?

@Pratikrocks Thanks for this addition!

@pratik0316

pratik0316 commented Apr 28, 2021

Copy link
Copy Markdown
Contributor Author

@pombredanne , please look into this too

@pombredanne

Copy link
Copy Markdown
Member

@Pratikrocks @MaJuRG sorry for the late reply. I am still thinking about this one because of "fingerprint" feels too generic as a name.

  • IMHO we should either have a specific single purpose attribute with a descriptive name, like deltacode_fingerprint... but then that cannot be in commoncode IMHO, as this would be too specific.
  • OR use fingerprints and make it a list of checksums and fingerprints with a prefix such as ['sha1-23462348623486', 'dcfp1-45345345345345']
  • OR use fingerprints and make it a mapping of checksums and fingerprints name/value pairs such as {'sha1': '23462348623486', 'dcfp1': '45345345345345'}

@pombredanne
pombredanne requested a review from JonoYang April 28, 2021 16:19
@pratik0316

Copy link
Copy Markdown
Contributor Author

OR use fingerprints and make it a list of checksums and fingerprints with a prefix such as ['sha1-23462348623486', 'dcfp1-45345345345345']
OR use fingerprints and make it a mapping of checksums and fingerprints name/value pairs such as {'sha1': '23462348623486', 'dcfp1': '45345345345345'}

@pombredanne we are already having an attribute for the sha in VirtualCodebase so IMO if we again club sha into the fingerprint , it would be a bit more redundant thing

@JonoYang

Copy link
Copy Markdown
Member

@pombredanne I think the field should be a mapping of {checksum name: checksum value}. This makes it easier to store and retrieve multiple fingerprint values in a sane way. I don't think it is efficient to have the fingerprints in a list where we have to parse the fingerprint string for the fingerprint type, then remove the type before we can use the fingerprint value. Also, the new fingerprint attribute should be renamed fingerprints to reflect that there could be multiple types of fingerprints for a file.

@pratik0316

Copy link
Copy Markdown
Contributor Author

@JonoYang currently we are dealing with a single fingerprint (which is the fingerprint plugin), upon using this plugin only a single unique fingerprint would be generated always, for a file.

@pombredanne

Copy link
Copy Markdown
Member

@JonoYang I like the switch to "fingerprints" as a mapping
@Pratikrocks we will eventually deprecate sha1/md5 and so on and move these under fingerprints. There will be surely other fingerprints too, so we do not have a single attribute there. Also the "fingerprint" used in DeltaCode needs to be given a unique and distinctive name

I kinda see checksums as a case of fingerprints

See https://en.wikipedia.org/wiki/Fingerprint_(computing) and https://csrc.nist.gov/glossary/term/Digital_Fingerprint

@pratik0316

Copy link
Copy Markdown
Contributor Author

@pombredanne, the fingerprint which we are having currently is using SimHash Algorithm, and its generated only as a plugin in Scancode.
And the sha1/md5 has its own algorithm to generate the hash.
And we are using the fingerprint plugin for the similarity calculations.

@pombredanne

Copy link
Copy Markdown
Member

@Pratikrocks re:

the fingerprint which we are having currently is using SimHash Algorithm, and its generated only as a plugin in Scancode.
And the sha1/md5 has its own algorithm to generate the hash.
And we are using the fingerprint plugin for the similarity calculations.

I get this. I am just saying that fingerprint is too generic as a term and at the same super-specific to a plugin and therefore I would not want to add this as a standard resource attribute. It can be a plugin-contributed attribute alright, but that still makes it aname that is too generic.

Overall I would rather prefer that we change the API and store checksums as a list of name/value pairs; and that we find a good name for the deltacode "fingerprint", may be something like a deltasim1 or something TBD.

@pratik0316

Copy link
Copy Markdown
Contributor Author

Yes @pombredanne I get your point :)

@pratik0316 pratik0316 closed this Jun 11, 2021
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

Successfully merging this pull request may close these issues.

4 participants