1.0.2 • Published 4 years ago

hashcode.ts v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

hashcode

A simple, yet powerful, hashcode helper

Installation

    npm install hashcode.ts
    # or ...
    yarn add hashcode.ts

Usage

   import Hashcode from "./hashcode";

   // You can use the generic form...
   const value = Hashcode.value({"hello": "world!"});

   // ... or the specific form if you know the type
   const boolean = Hashcode.boolean(true);
   const number = Hashcode.number(1337);
   const string = Hashcode.string("Hello world!");
   const date = Hashcode.date(new Date());
   const array = Hashcode.array([42, 1337]);
   const object = Hashcode.object({"hello": "world!"});

   // There is also an helper for combining hashcodes
   const hash = Hashcode.combine(boolean, number, string);