Re: [BackupPC-users] Digest::MD5 vs md5sum

2015-09-15 Thread Holger Parplies
Hi,

gregrwm wrote on 2015-09-15 14:08:20 -0500 [[BackupPC-users] Digest::MD5 vs 
md5sum]:
> the following commands demonstrate that either Digest::MD5 and gnu md5sum
> are not compatible, or that i haven't got the backuppc md5 formula quite
> right.  can anyone set me straight?

probably not, considering your obfuscated bash code. Where did you get the
idea to 4b $s? You might try echo -n ning it instead. Not that I'd tried it or
would feel inclined to do so. Actually, I have to admit that I just *did* try
it.

Hope that helps. Not sure what you are actually trying to do, though.

Regards,
Holger

--
___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/


[BackupPC-users] Digest::MD5 vs md5sum

2015-09-15 Thread gregrwm
the following commands demonstrate that either Digest::MD5 and gnu md5sum
are not compatible, or that i haven't got the backuppc md5 formula quite
right.  can anyone set me straight?  the commands below merely use the
filesize, and the whole file since it's <256K, feed them both to md5sum,
and show the result adjacent the filename.  the below shows /etc/papersize
and it's poolfile:

$ alias zcat=/usr/share/?ackup??/bin/BackupPC_zcat
> $ alias li=ls' -aFqldi --color --time-style=+%F" %a "%T'
> $ 1b()(printf \\x$(printf %x $1))
> $ 2b()(1b $(($1  /  256));1b $(($1%  256)))
> $ 4b()(2b $(($1%2**32/65536));2b $(($1%65536))) #write rightmost 4 bytes
> $ 4b 513 |xxd   #4b sanity tests
> 000:  0201
> $ 4b 65539   |xxd
> 000: 0001 0003
> $ 4b $((2**32-7))|xxd
> 000:  fff9
> $ 4b $((2**32+9))|xxd
> 000:  0009
> $ md5sum --version|head -1
> md5sum (GNU coreutils) 8.13
> $ um()(s=$( cat $1|wc -c) m=$((4b $s; cat $1|sf)|md5sum);echo $(li $1) $m
> s=$s) #li & md5 of uncompressed argfile
> $ zm()(s=$(zcat $1|wc -c) m=$((4b $s;zcat $1|sf)|md5sum);echo $(li $1) $m
> s=$s) #li & md5 of  compressed argfile
> $ sf()if [ $s -le $(( 256*1024)) ];then
> cat #select filedata for md5
> >   elif [ $s -le $((1024*1024)) ];then
> >  dd bs=128K count=1
> >  tail -c128K
> >   else
> >  dd bs=128K count=1
> >  dd bs=128K skip=6 count=1
> >   fi
> $ cat /etc/papersize
> a4
> $ xxd /etc/papersize
> 000: 6134 0a  a4.
> $ um /etc/papersize
> 349898 -rw-r--r-- 1 root root 3 2014-01-01 Wed 17:39:09 /etc/papersize
> 12cf0b6059ccc2701eb9e55277f161c2 - s=3
> $ zm /var/lib/backuppc/pc/127.0.0.1/0/f%2f/fetc/fpapersize
> 19720838 -rw-r- 40 backuppc backuppc 11 2015-04-23 Thu 02:30:49
> /var/lib/backuppc/pc/127.0.0.1/0/f%2f/fetc/fpapersize
> 12cf0b6059ccc2701eb9e55277f161c2 - s=3
> $ zm /var/lib/backuppc/cpool/7/a/5/*991
> 19720838 -rw-r- 40 backuppc backuppc 11 2015-04-23 Thu 02:30:49
> /var/lib/backuppc/cpool/7/a/5/7a59e82651106239413a38eb30735991
> 12cf0b6059ccc2701eb9e55277f161c2 - s=3
>
--
___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/