This package can be used to generate a unique identifier (number) for an object / function / symbol. This kind of numeric identifier can be used to compute hash, generate debug trace, etc.
npm install @w5s/object-idimport { objectId } from '@w5s/object-id';
export function main(): void {
const someObject = { foo: 1 };
const id = objectId(someObject); // typeof id === 'number'
console.log(id === objectId(someObject)); // true (because idempotent)
}MIT © Julien Polo julien.polo@gmail.com