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

Add support for Simple File Verification #6098

Merged
merged 4 commits into from
Oct 19, 2022
Merged

Add support for Simple File Verification #6098

merged 4 commits into from
Oct 19, 2022

Conversation

Alhadis
Copy link
Collaborator

@Alhadis Alhadis commented Sep 29, 2022

Summary

This pull-request adds support for Simple File Verification (.sfv) files, which contain a list of file checksums in CRC-32 format:

; This is a comment
file_one.zip   c45ad668
file_two.zip   7903b8e6
file_three.zip e99a65fb

Description

Unlike the ad-hoc formats added in #5138, SFV uses an explicit (albeit poorly-documented) syntax that supports comments and quoted filenames. Some SFV readers are also picky about whitespace and punctuation separating the filename from the checksum. Some even support multiline comment blocks, which are typically intended for those annoying banners that script-kiddies love stuffing into their WaReZ's .NFO files:

;!SFV_COMMENT_START
 _ _______________             ___   ___  _            _
| |___ /___ /___  | __      __/ _ \ / _ \| |_      ___| |_ ___
| | |_ \ |_ \  / /  \ \ /\ / / | | | | | | __|    / _ \ __/ __|
| |___) |__) |/ /    \ V  V /| |_| | |_| | |_ _  |  __/ || (__
|_|____/____//_/      \_/\_/  \___/ \___/ \__( )  \___|\__\___|
                                             |/
;!SFV_COMMENT_END

These considerations rule out the possibility of using the checksum grammar I wrote for #5138, which was designed to handle freeform text broken up by well-formed checksum lists (like readmes, verification instructions, etc).

Colour rationale

#C9BFED was taken from the CRC-32 checksum of the words "Simple File Verification".

λ printf '%x\n' "`printf 'Simple File Verification' | cksum -o3 | cut -d\  -f1`"
c9bfed14

Checklist:

  • I am adding a new language
    • The extension of the language is used in hundreds of repositories:
      ~5,490 results for the .sfv extension (~320 results in Code Search)
    • I have included a real-world usage sample.
      Finding a permissively-licensed example was next to impossible, so I took to generating samples using rhash(1).
    • I have included a syntax highlighting grammar
    • I have updated the heuristics

@Alhadis Alhadis requested a review from a team as a code owner September 29, 2022 12:36
@Alhadis Alhadis merged commit ab040f2 into master Oct 19, 2022
@Alhadis Alhadis deleted the sfv branch October 19, 2022 11:13
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants