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

hashAnything should also hash circular structures #3

Open
jesobreira opened this issue Jun 12, 2020 · 1 comment
Open

hashAnything should also hash circular structures #3

jesobreira opened this issue Jun 12, 2020 · 1 comment

Comments

@jesobreira
Copy link

Since the lib claims to be able to "Hash any Javascript primitive or object", from my point of view, circular structures should also be supported.

Instead, it throws a "Maximum call stack size exceeded" error...

Example code:

var hashAnything = require("hash-anything")
let circular = { "foo": "bar" }
circular.myself = circular
hashAnything.md5(circular)

Tip: flatted should be used to stringify circular structures

@ben-page
Copy link
Owner

Thanks for the feedback. Feel free to create a PR for this. However, flatted wont help. hash-anything does not stringify the object before hashing.

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