Hasher generates different hashes every run for the same data
Hasher generates different hashes every run for the same data.
It happens in AWS Lambda with docker images:
- public.ecr.aws/lambda/nodejs:20-arm64
- public.ecr.aws/lambda/nodejs:22-arm64
Hi. Can you create minimal example to reproduce the issue?
Hi. I have tried to create a minimal reproduction of this issue... It's very complicated. It looks like it happens when I have installed package (node-object-hash) in root package.json and also in sub-package:
"dependencies": {
"some-package": "0.0.1",
----> "node-object-hash": "3.0.0"
"node-object-hash": "3.0.0"
},
Functions in this sub-package generate different hashes every run for the same data. It works when I remove the package (node-object-hash) from root package.json. And It happens only in aws lambda - it's weird.
I'll try to reproduce it, but I have a large project with many custom packages...
And It happens only in aws lambda - it's weird.
Might be there's some issue with "minification" or whatever lambda could make under the hood. You can also try using not hasher, but just sort https://github.com/SkeLLLa/node-object-hash?tab=readme-ov-file#sortobject and log the results in order to see what's hashed.