javascript - How do I efficiently hash an image for indexed search in the browser? -


i'm writing chrome extension saves images websites. in addition saving files themselves, i'd turn images type of hash.

the objective index images in database can determine if image duplicate (independent of size, i.e., thumbnail , full-size image considered duplicates). i'm not worried images slight differences (besides size).

i've tried work this library, it's large, bit slower i'd like, , (ostensibly) not supported anymore.

i've tried number of phash algorithm implementations, near can tell, they're intended server-side use. i'm using webpack, unable bundle of libs tried (very possible user-error, i'm no webpack-pro).

lastly, tried converting image base64, results 10k+ characters, , it's not clear me work images of different sizes.

i implement fast string hash in javascript. convert image base64, run string hash on it:

https://www.npmjs.com/package/non-crypto-hash (these work in both node , browser, bring in browserify)

or algorithm can convert: http://landman-code.blogspot.ca/2008/06/superfasthash-from-paul-hsieh.html

assuming don't need cryptographically secure hash, these speediest options.


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -