shuding / stable-hash

Stable JS value hash

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Isomorphic objects with circular references

shuding opened this issue · comments

const o1 = {}; o1.o = o1
const o2 = {}; o2.o = o2

hash(o1) !== hash(o2) // bug!

To fix this problem, we need an extra WeakMap and a reference counter only for recursive hash executions.