Skip to content

Commit

Permalink
Fix usage of named export for CommonJS module (MystenLabs#6692)
Browse files Browse the repository at this point in the history
  • Loading branch information
666lcz authored Dec 9, 2022
1 parent c9e8bef commit f93b59f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-boats-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@mysten/sui.js": patch
---

Fixed usage of named export for CommonJS module
4 changes: 2 additions & 2 deletions sdk/typescript/src/cryptography/hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import { fromHEX } from '@mysten/bcs';
import { sha3_256 } from 'js-sha3';
import sha3 from 'js-sha3';

/**
* Generates a SHA 256 hash of typed data as a base64 string.
Expand All @@ -11,7 +11,7 @@ import { sha3_256 } from 'js-sha3';
* @param data data to hash
*/
export function sha256Hash(typeTag: string, data: Uint8Array): Uint8Array {
const hash = sha3_256.create();
const hash = sha3.sha3_256.create();

const typeTagBytes = Array.from(`${typeTag}::`).map((e) => e.charCodeAt(0));

Expand Down

0 comments on commit f93b59f

Please sign in to comment.