Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unique image hash
#1
I'm working with images and I'm trying to think of the best way to avoid processing them multiple times.

My thought is to read the file and generate a hash of the content to create a filename based on that.

-Jim
#2
32-bit hash - Crc32(file 0 1)
128-bit hash - str.encrypt(2|8 file "" 0x100)
#3
I'm thinking I'll use DateTime + the first 4 characters from str HASH.encrypt(2|8 sPath "" 0x100) to return things like:

130210821264631349_543A.jpg
130210821265881565_655D.jpg
130210821267131781_0EFF.jpg

That's about as long as I want files names to be.
I also want to be able to sort by the original date created...so having that information in the filename is important.

Better ideas?
jim
#4
4 hex characters = 2 bytes = 65536 unique values.
4 bytes would be >4000000000 unique values. Crc32 creates a 4-byte hash.
#5
I don't know if I am getting the Crc32 to work
"out Crc32(sPath 4 1)" outputs like:
-1957881914
27141269
233437840
-551937856

same as "out Crc32(sPath 0 1)"
-1957881914
27141269
233437840
-551937856

Not sure what it is supposed to be like


Forum Jump:


Users browsing this thread: 1 Guest(s)