-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 hash sum files (tools like sha256sum) #5130
Comments
There's also OpenBSD's checksumming tools that generate output of the form:
Syntax aside, this sounds like it would be doable. We just need to have a concrete list of filenames to go by (e.g., |
Ubuntu uses The list should include file names for various hashes (MD5, SHA1, SHA224, SHA256, SHA384, SHA512, etc.) like
plus file names that do not include the hash type, like
If there are other common file names, they should be added, and if some are not common, they should be removed. It should also support ``` blocks, possibly something like one of these: ```hash, ```sum, ```sums |
@theonlypwner If you feel like submitting a pull-request, I've added a basic grammar that highlights checksum lists. Since the |
What changes need to be made to Linguist? Is it just adding an entry to 3 files ( Also, in Alhadis/language-etc@2f8309a, would |
The process is documented in The time-consuming part isn't so much the changes to Linguist, but researching in-the-wild usage using Harvester. Of course, that step becomes moot if a search tosses up a six-figure number of results, at which point we can safely assume there's 100+ users among them. 😉
Ah sorry, I could have been clearer on that point... it's common for checksum lists to contain blocks of prose before and/or after the actual checksums. I wasn't comfortable highlighting
Such a line would match a CRC-32 of (Also, I reasoned that cyclic redundancy checks are the least likely to be stored on-disk, since CRCs are fast to compute—it would behove authors to pick a secure algorithm if they wanted to prepare a checksum list ahead-of-time). |
My Ruby environment has issues when running I asked
because I was wondering whether it'll be too tricky to support, with the false positives. It looks like we shouldn't try to detect it, but is there a way to highlight it when it is explicitly specified, such as ```hash blocks in Markdown? |
Unfortunately not. |
Would it make sense to cover single-hash files that are usually identified with the extension (e.g. |
Yes, I've added entries under |
Don't the blocks below highlight differently? They are int main() {} // <strong attr="val">HTML</strong> int main() {} // <strong attr="val">HTML</strong>
|
Tools like
md5sum
,shasum
,sha1sum
,sha256sum
,sha3sum
, andb2sum
output one line per input file:If the file was stdin, the file name is
-
.For example, in binary mode, the output looks like this:
In text mode, the output looks like this:
cksum
is similar, but it outputs the checksum in decimal, a space, the file size (with all trailing null bytes trimmed), a space, and the file name. If the file was stdin, the last two parts are omitted.The text was updated successfully, but these errors were encountered: