Skip to content

Commit

Permalink
fix: revert "simplify type for v3 and v5" (#835)
Browse files Browse the repository at this point in the history
This reverts commit 2e09800.
  • Loading branch information
broofa authored Nov 4, 2024
1 parent c8866d9 commit e2dee69
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ import v35, { DNS, URL } from './v35.js';

export { DNS, URL } from './v35.js';

function v3(
value: string | Uint8Array,
namespace: UUIDTypes,
buf?: undefined,
offset?: number
): string;
function v3(
value: string | Uint8Array,
namespace: UUIDTypes,
buf: Uint8Array,
offset?: number
): Uint8Array;
function v3(value: string | Uint8Array, namespace: UUIDTypes, buf?: Uint8Array, offset?: number) {
return v35(0x30, md5, value, namespace, buf, offset);
}
Expand Down
12 changes: 12 additions & 0 deletions src/v5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ import v35, { DNS, URL } from './v35.js';

export { DNS, URL } from './v35.js';

function v5(
value: string | Uint8Array,
namespace: UUIDTypes,
buf?: undefined,
offset?: number
): string;
function v5(
value: string | Uint8Array,
namespace: UUIDTypes,
buf: Uint8Array,
offset?: number
): Uint8Array;
function v5(value: string | Uint8Array, namespace: UUIDTypes, buf?: Uint8Array, offset?: number) {
return v35(0x50, sha1, value, namespace, buf, offset);
}
Expand Down

0 comments on commit e2dee69

Please sign in to comment.