用的命令md5sum
,sha1sum
,sha256sum
我可以采取具有散列和每行的路径中的文本文件,并验证文件的整个列表中的单个命令,像sha1sum -c mydir.txt
。(使用循环find
或其他方式,很容易生成所述文本文件。)
有没有办法对CRC / CRC32哈希值列表进行同样的处理?
这些哈希通常存储在类似ZIP的存档中,例如ZIP本身或7z。例如:
$ unzip -v archive.zip
Archive: archive.zip
Length Method Size Cmpr Date Time CRC-32 Name
-------- ------ ------- ---- ---------- ----- -------- ----
8617812 Stored 8617812 0% 12-03-2015 15:20 13fda20b 0001.tif
或者:
$ 7z l -slt archive.7z
Path = filename
Size = 8548096
Packed Size =
Modified = 2015-12-03 14:20:20
Attributes = A_ -rw-r--r--
CRC = B2F761E3
Encrypted = -
Method = LZMA2:24
Block = 0
尝试RHash。
$ echo -n a > a.txt; echo -n b > b.txt; echo -n c > c.txt
✔
$ rhash --crc32 --simple *.txt > checksums.crc32
✔
$ cat checksums.crc32
e8b7be43 a.txt
71beeff9 b.txt
06b9df6f c.txt
✔
$ rhash --crc32 --check checksums.crc32
--( Verifying checksums.crc32 )-------------------------------------------------
a.txt OK
b.txt OK
c.txt OK
--------------------------------------------------------------------------------
Everything OK
✔
如果您不使用--simple
格式设置选项,则rash将默认使用其他格式。这可能不是您想要的:
$ rhash --crc32 *.txt
; Generated by RHash v1.3.7 on 2020-06-03 at 16:02.51
; Written by Kravchenko Aleksey (Akademgorodok) - http://rhash.sf.net/
;
; 1 15:58.36 2020-06-03 a.txt
; 1 15:58.36 2020-06-03 b.txt
; 1 15:58.36 2020-06-03 c.txt
a.txt E8B7BE43
b.txt 71BEEFF9
c.txt 06B9DF6F
✔
如果您想发疯:请尝试一次获取所有受支持的哈希值的--all
选项。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句