Subject |
Re: hash.cc |
From |
Sean <sean@seanwessels.co.za> |
Date |
Thu, 29 Feb 2024 23:49:56 -0500 |
Newsgroups |
dbase.getting-started |
Hi Marc,
You were absolutely right, although, what was strange is that running the hashX iterated over all my rows, switching to hash does one of two things (naturally depending on the code position within the loop):
1. The same hash is generated for each row of data, even though the data is different.
2. Only the first rows hash is generated (even though im running a loop over each row, see comment about hashX working fine here).
The whole reason this came about was to identify changes within the rows of data. This was my attempt at trying to find a clever way to do this, perhaps too clever.
Marc VdB Wrote:
> Hi Sean,
>
> if i should guess, i would say you are using the gethashx-method. This
> one is used to add a second layer of security by making sure, that the
> hash-values never are the same, even if the input is the same.
>
> If you use the gethash (without x) equal input will give equal output.
>
> This said, if not for special circumstances, a direct comparison to
> check for differences would be faster, because you don't have to
> calculate the hash value
>
> HTH,
> Marc
>
> > If I may ask a noob question. I wanted to use the hash function to check whether data within a dataset has changed between two days. This to my brain seems like a good use.
> >
> > When I run the hash, the values populated change for each iteration I run. So each rows hash is never the same which null and voids my use case - am I potentially doing something wrong (more like what am I doing wrong?!).
> >
> > Sean
>
|
|