@cursorsdottsx/h
v1.0.1
Published
A pretty bad implementation of a hashcode that works 99.9% of the time.
Downloads
1
Readme
| a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z |
H is for Hashcode
@cursorsdottsx/h
A pretty bad implementation of a hashcode that works 99.9% of the time.
Installation
Hashcode can be installed with either NPM or Yarn.
npm install @cursorsdottsx/h
yarn add @cursorsdottsx/h
Usage
Upon importation of Hashcode, it will modify the Object
global and give objects a hashCode
method.
require("@cursorsdottsx/h");
import "@cursorsdottsx/h";
Documentation
Object.prototype.hashCode(): string
Examples
({ foo: "bar" }).hashCode(); // => KE9iamVjdCRmb28jc3RyaW5nOmZvbyk=
({ object: { pls: "install" }, hello: "world", }).hashCode(); // => KE9iamVjdCRvYmplY3QjS0U5aWFtVmpkQ1J3YkhNamMzUnlhVzVuT25Cc2N5az1AaGVsbG8jc3RyaW5nOmhlbGxvKQ==
The hashcode of an object should be the same, and two objects with the same hashcode should be the same. If this is not true for a pair of objects please open an issue (properties that are not enumerable don't count).