Skip to content

Commit

Permalink
Create breezy-seahorses-prove.md
Browse files Browse the repository at this point in the history
  • Loading branch information
holic authored Oct 31, 2023
1 parent 4076100 commit 4597bb5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .changeset/breezy-seahorses-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
"@latticexyz/utils": major
---

Removed `keccak256` and `keccak256Coord` hash utils in favor of [viem's `keccak256`](https://viem.sh/docs/utilities/keccak256.html#keccak256).

```diff
- import { keccak256 } from "@latticexyz/utils";
+ import { keccak256, toHex } from "viem";

- const hash = keccak256("some string");
+ const hash = keccak256(toHex("some string"));
```

```diff
- import { keccak256Coord } from "@latticexyz/utils";
+ import { encodeAbiParameters, keccak256, parseAbiParameters } from "viem";

const coord = { x: 1, y: 1 };
- const hash = keccak256Coord(coord);
+ const hash = keccak256(encodeAbiParameters(parseAbiParameters("int32, int32"), [coord.x, coord.y]));
```

0 comments on commit 4597bb5

Please sign in to comment.