Return-Path: william@bourbon.usc.edu
Delivery-Date: Tue Apr 17 09:57:06 2007
X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu
X-Spam-Level: 
X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	NO_REAL_NAME autolearn=ham version=3.1.3
Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75])
	by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id l3HGv6TO024341
	for <cs551@merlot.usc.edu>; Tue, 17 Apr 2007 09:57:06 -0700
Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1])
	by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id l3HGv9Pe031342
	for <cs551@merlot>; Tue, 17 Apr 2007 09:57:09 -0700
Message-Id: <200704171657.l3HGv9Pe031342@bourbon.usc.edu>
To: cs551@merlot.usc.edu
Subject: Re: proj 2 
Date: Tue, 17 Apr 2007 09:57:09 -0700
From: william@bourbon.usc.edu

Someone wrote:

  > Question 1:
  > I have a doubt in search response. I can not understand what
  > is FileID in file response.
  > 
  > [1] FileID=02adefc1dfc97a082fa18a5ef1e8c487259b7fb4
  >       FileName=foo
  >       FileSize=123
  >       SHA1=b83a758fecbefcd3ea547fbf0f9a97eba0ea984c
  >       Nonce=01b7a1bd6f169dde22518a865ab2f44c70fcab82
  >       Keywords=key1 key2 key3

Please see the following for an explanation of FileID:

    http://merlot.usc.edu/cs551-s07/projects/final.html#nonce

  > Question2:
  > 
  > I accidentally find out that i am getting correct hash of any
  > text file  but getting wrong hash of .mp3 and .jpg file. Can
  > you tell me why this is happening ?.

If you are getting correct hash values for ASCII text files
but incorrect ones for binary files, then you probably are
reading the input file using some functions that assumes
the input file is an ASCII text file.

One way you can check if this is happening is keep track of
how many bytes of data you've read.  When you are done with
reading the file, check the total number of bytes you have
read and that must be the same as the file size.  If it's
not, you know you are doing something wrong.  There is a
hexdump program at:

    ~csci551b/bin/hexdump

You can use it to do a hexdump of the file you are having
problem with and check it against what your code have read.
--
Bill Cheng // bill.cheng@usc.edu <URL:http://merlot.usc.edu/william/usc/>
