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

Figure out object identity #2

Open
davidaurelio opened this issue Mar 2, 2015 · 3 comments
Open

Figure out object identity #2

davidaurelio opened this issue Mar 2, 2015 · 3 comments

Comments

@davidaurelio
Copy link
Contributor

Style object identity should be based on property names, order, and string values.

@davidaurelio davidaurelio added this to the Initial Release milestone Mar 2, 2015
@davidaurelio
Copy link
Contributor Author

Considerations:

@davidaurelio
Copy link
Contributor Author

A simple hashing function à la

function hash(obj) {
  var hash = [];
  for (var key in obj) {
    hash.push(key, obj[key]);
  }
  return hash.join('\0');
}

seems to be faster than anything else (sigmund, JSON.stringify) and is certainly good enough for our purpose.

@davidaurelio
Copy link
Contributor Author

We could even filter out prefixed properties

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

1 participant