aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Samual Norman <me@samual.uk> 2023-09-08 17:32:36 +0100
committerGravatar GitHub <noreply@github.com> 2023-09-08 09:32:36 -0700
commit182d3f1567eb37a01c278f5912ee48d6e4546642 (patch)
tree2b866ad5fed6391c6f63fe3e4e0ba39e11ecd117
parent189f0f7c369e5391e6f09ce7d2c8fa5b59cc01d6 (diff)
downloadbun-182d3f1567eb37a01c278f5912ee48d6e4546642.tar.gz
bun-182d3f1567eb37a01c278f5912ee48d6e4546642.tar.zst
bun-182d3f1567eb37a01c278f5912ee48d6e4546642.zip
Fix `Bun.CryptoHasher` missing argument in docs (#4585)
-rw-r--r--docs/api/hashing.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/api/hashing.md b/docs/api/hashing.md
index 0a32b567d..13d09dbfe 100644
--- a/docs/api/hashing.md
+++ b/docs/api/hashing.md
@@ -132,7 +132,7 @@ hasher.digest();
Once initialized, data can be incrementally fed to to the hasher using `.update()`. This method accepts `string`, `TypedArray`, and `ArrayBuffer`.
```ts
-const hasher = new Bun.CryptoHasher();
+const hasher = new Bun.CryptoHasher("sha256");
hasher.update("hello world");
hasher.update(new Uint8Array([1, 2, 3]));
@@ -170,7 +170,7 @@ hasher.update("hello world", "latin1");
After the data has been feed into the hasher, a final hash can be computed using `.digest()`. By default, this method returns a `Uint8Array` containing the hash.
```ts
-const hasher = new Bun.CryptoHasher();
+const hasher = new Bun.CryptoHasher("sha256");
hasher.update("hello world");
hasher.digest();