@automerge/automerge-repo 0.2.0 → 0.2.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.
@@ -1,8 +1,8 @@
1
1
  import * as A from "@automerge/automerge";
2
2
  import { mergeArrays } from "../helpers/mergeArrays.js";
3
- import sha256 from "fast-sha256";
3
+ import * as sha256 from "fast-sha256";
4
4
  function keyHash(binary) {
5
- const hash = sha256(binary);
5
+ const hash = sha256.hash(binary);
6
6
  const hashArray = Array.from(new Uint8Array(hash)); // convert buffer to byte array
7
7
  const hashHex = hashArray.map(b => ("00" + b.toString(16)).slice(-2)).join(""); // convert bytes to hex string
8
8
  return hashHex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automerge/automerge-repo",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "A repository object to manage a collection of automerge documents",
5
5
  "repository": "https://github.com/automerge/automerge-repo",
6
6
  "author": "Peter van Hardenberg <pvh@pvh.ca>",
@@ -62,5 +62,5 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "gitHead": "b17ea68dce605c06e57e4fcd6e6295ef968a8b6d"
65
+ "gitHead": "7f048ecaa62eb1246f54773c6b10bada0767497b"
66
66
  }
@@ -2,10 +2,10 @@ import * as A from "@automerge/automerge"
2
2
  import { DocumentId } from "../types.js"
3
3
  import { StorageAdapter } from "./StorageAdapter.js"
4
4
  import { mergeArrays } from "../helpers/mergeArrays.js"
5
- import sha256 from "fast-sha256"
5
+ import * as sha256 from "fast-sha256"
6
6
 
7
7
  function keyHash(binary: Uint8Array) {
8
- const hash = sha256(binary)
8
+ const hash = sha256.hash(binary)
9
9
  const hashArray = Array.from(new Uint8Array(hash)) // convert buffer to byte array
10
10
  const hashHex = hashArray.map(b => ("00" + b.toString(16)).slice(-2)).join("") // convert bytes to hex string
11
11
  return hashHex