Skip to content

Commit f851c02

Browse files
fix(sdk): Remove stray call to node:Buffer (#365)
1 parent 3d602ad commit f851c02

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/tdf3/src/models/assertion.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { canonicalizeEx } from 'json-canonicalize';
22
import { SignJWT, jwtVerify } from 'jose';
33
import { AssertionKey } from './../client/AssertionConfig.js';
4+
import { hex } from '../../../src/encodings/index.js';
45
import { ConfigurationError, InvalidFileError } from '../../../src/errors.js';
56

67
export type AssertionKeyAlg = 'RS256' | 'HS256';
@@ -47,7 +48,7 @@ export async function hash(this: Assertion): Promise<string> {
4748
const result = canonicalizeEx(this, { exclude: ['binding', 'hash', 'sign', 'verify'] });
4849

4950
const hash = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(result));
50-
return Buffer.from(hash).toString('hex');
51+
return hex.encodeArrayBuffer(hash);
5152
}
5253

5354
/**

0 commit comments

Comments
 (0)