Skip to content

Commit

Permalink
refactor(crypto/_fnv): bring into standards (#3212)
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua authored Feb 23, 2023
1 parent 1f96d9f commit ec65255
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crypto/_fnv/index.ts → crypto/_fnv/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { fnv32, fnv32a } from "./fnv32.ts";
import { fnv64, fnv64a } from "./fnv64.ts";

export const fnv = (name: string, buf: Uint8Array | undefined): ArrayBuffer => {
export function fnv(name: string, buf?: Uint8Array): ArrayBuffer {
if (!buf) {
throw new TypeError("no data provided for hashing");
}
Expand All @@ -21,4 +21,4 @@ export const fnv = (name: string, buf: Uint8Array | undefined): ArrayBuffer => {
default:
throw new TypeError(`unsupported fnv digest: ${name}`);
}
};
}
2 changes: 1 addition & 1 deletion crypto/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ import {
instantiateWasm,
} from "./_wasm/mod.ts";
import { timingSafeEqual } from "./timing_safe_equal.ts";
import { fnv } from "./_fnv/index.ts";
import { fnv } from "./_fnv/mod.ts";

/**
* A copy of the global WebCrypto interface, with methods bound so they're
Expand Down

0 comments on commit ec65255

Please sign in to comment.