/* ** 2013-10-01 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** Compute hash signatures for every page of a database file. This utility ** program is useful for analyzing the output logs generated by the ** ext/misc/vfslog.c extension. */ #include #include #include #include /* ** Compute signature for a block of content. ** ** For blocks of 16 or fewer bytes, the signature is just a hex dump of ** the entire block. ** ** For blocks of more than 16 bytes, the signature is a hex dump of the ** first 8 bytes followed by a 64-bit hash of the entire block. */ static void vlogSignature(unsigned char *p, int n, char *zCksum){ unsigned int s0 = 0, s1 = 0; unsigned int *pI; int i; if( n<=16 ){ for(i=0; i