mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 19:04:45 +03:00
ZTS: Replace MD5 and SHA256 wit XXH128
For data integrity checks as done in ZTS, the verification for unintended data corruption with xxhash128 should be a lot faster and perfectly usable. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de> Closes #16577
This commit is contained in:
@@ -3455,35 +3455,26 @@ function tunable_exists
|
||||
}
|
||||
|
||||
#
|
||||
# Compute MD5 digest for given file or stdin if no file given.
|
||||
# Compute xxh128sum for given file or stdin if no file given.
|
||||
# Note: file path must not contain spaces
|
||||
#
|
||||
function md5digest
|
||||
function xxh128digest
|
||||
{
|
||||
openssl md5 -r $1 | awk '{print $1}'
|
||||
xxh128sum $1 | awk '{print $1}'
|
||||
}
|
||||
|
||||
#
|
||||
# Compare the MD5 digest of two files.
|
||||
# Compare the xxhash128 digest of two files.
|
||||
#
|
||||
function cmp_md5s {
|
||||
function cmp_xxh128 {
|
||||
typeset file1=$1
|
||||
typeset file2=$2
|
||||
|
||||
typeset sum1=$(md5digest $file1)
|
||||
typeset sum2=$(md5digest $file2)
|
||||
typeset sum1=$(xxh128digest $file1)
|
||||
typeset sum2=$(xxh128digest $file2)
|
||||
test "$sum1" = "$sum2"
|
||||
}
|
||||
|
||||
#
|
||||
# Compute SHA256 digest for given file or stdin if no file given.
|
||||
# Note: file path must not contain spaces
|
||||
#
|
||||
function sha256digest
|
||||
{
|
||||
openssl sha256 -r $1 | awk '{print $1}'
|
||||
}
|
||||
|
||||
function new_fs #<args>
|
||||
{
|
||||
case "$UNAME" in
|
||||
|
||||
Reference in New Issue
Block a user