You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to hash a 256 mb Uint8array crashes the node instance with an out of memory. It appears the base object is just too large to be handled this way. It would be nice to not convert array buffers into strings, but hash them raw.
The text was updated successfully, but these errors were encountered:
It is a significant change to do this correctly - the right way of doing this is to provide hash generator to the child nodes so that you never create a full string, but do it piecemeal. The issue with that is it is quite different in design from the current behaviour. That would make it quite a bit faster, because you wouldn't be combining/moving strings in large numbers the way it does now, but trying to do that the way it is now would be hard.
There is a pair of simple changes that would "fix" things - that is, would make them reasonably fast, without changing the structure much:
If the incoming object is an ArrayBuffer type, then return the hash code directly
For the "toString" method on values, return the hash code of ArrayBuffer instances rather than a string representation
Those two changes would allow either simple objects or things contains arrays to be hashed at a reasonable speed.
Trying to hash a 256 mb Uint8array crashes the node instance with an out of memory. It appears the base object is just too large to be handled this way. It would be nice to not convert array buffers into strings, but hash them raw.
The text was updated successfully, but these errors were encountered: