@rbxts/hash 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +25 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,27 @@
1
- # Package template
1
+ # @rbxts/hash
2
2
 
3
- [![CI Status](https://github.com/R-unic/package-template/actions/workflows/test.yml/badge.svg)](https://github.com/R-unic/package-template/actions/workflows)
4
- [![Coverage Status](https://coveralls.io/repos/github/R-unic/package-template/badge.svg?branch=master)](https://coveralls.io/github/R-unic/package-template)
3
+ [![CI Status](https://github.com/R-unic/hash/actions/workflows/test.yml/badge.svg)](https://github.com/R-unic/hash/actions/workflows)
4
+ [![Coverage Status](https://coveralls.io/repos/github/R-unic/hash/badge.svg?branch=master)](https://coveralls.io/github/R-unic/hash)
5
5
 
6
- Package template for roblox-ts with rUnit testing, coverage tracking, and file structure already set up
6
+ Utility for computing and combining hash codes.
7
+
8
+ ```ts
9
+ import { Hash } from "@rbxts/hash";
10
+
11
+
12
+ class User {
13
+ public constructor(
14
+ public readonly name: string,
15
+ public readonly age: number
16
+ ) { }
17
+
18
+ public hashCode(): number {
19
+ return Hash.combine(this.name, this.age);
20
+ }
21
+ }
22
+
23
+ const bob = new User("Bob", 20);
24
+ const alice = new User("Alice", 21);
25
+ print(bob.hashCode() === bob.hashCode()); // true
26
+ print(bob.hashCode() === alice.hashCode()); // false
27
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/hash",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A utility for generating hash codes for objects",
5
5
  "author": "me",
6
6
  "main": "out/init.lua",