Tom,

You are right with the couple of examples there, that Hash() should 
recognize a binary object and act accordingly.   That is something we 
can easily fix, and will do.

However, sending in a FileOpen() is somewhat dangerous.  What if an 
operation on the file has already happened prior to the call to Hash()? 
  The internal pointers of the FileOpen() is a completely different 
context than that of simply skipping along the bytes for the sake of a 
hash calculation.

So while I accept the current Hash() can be made to be more robust, the 
need for HashBinary() to handle a simple file handle, will ultimately 
prove to be a very useful addition to the stable of CFML functions.

Now, if you want to discuss "mistakes" in terms of methods that should 
never have been there, take a look at the SpreadSheet world -- a 
complete mess, while missing many of the features you would actually 
want to do.  I have a blog entry to still write about this ill-thought 
out knee-jerk reaction to provide "spreadsheet" functionality to the 
cfml world.   OpenBD supports it, but we've also filled in the gaps left 
open by some other engine implementations.

A number of new things coming up this week ... stay tuned.

TomD wrote:
> Before HashBinary gets widespread use, please consider changing the
> existing Hash function so it "just works".
> i.e.
>     Hash(myString)             should work as it does now; where
> myString implies toString() except for a file handle or ByteArray.
>     Hash(myByteArray)          should recognize that it is binary data.
>     Hash( FileOpen(myFile) )   should recognize it is a file, and
> process it in chunks for efficiency.
>
> IMHO EncryptBinary and DecryptBinary were also mistakes - there was no
> reason that Encrypt/Decrypt couldn't recognize and handle binary data
> without requiring new function names.

--~--~---------~--~----~------------~-------~--~----~
Open BlueDragon Public Mailing List
 http://groups.google.com/group/openbd?hl=en
 official site @ http://www.openbluedragon.org/

!! save a network - trim replies before posting !!
-~----------~----~----~----~------~----~------~--~---

Reply via email to