Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hasher generates different hashes every run for the same data #65

Open
shadoworion opened this issue Nov 28, 2024 · 3 comments
Open

Hasher generates different hashes every run for the same data #65

shadoworion opened this issue Nov 28, 2024 · 3 comments

Comments

@shadoworion
Copy link

Hasher generates different hashes every run for the same data.

It happens in AWS Lambda with docker images:

  1. public.ecr.aws/lambda/nodejs:20-arm64
  2. public.ecr.aws/lambda/nodejs:22-arm64
@SkeLLLa
Copy link
Owner

SkeLLLa commented Nov 28, 2024

Hi. Can you create minimal example to reproduce the issue?

@shadoworion
Copy link
Author

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...

@SkeLLLa
Copy link
Owner

SkeLLLa commented Nov 28, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants