Skip to content

Commit

Permalink
added sha256 test for empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
imolorhe committed Nov 3, 2024
1 parent 24489f9 commit 58948c0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/altair-core/src/oauth2/helpers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ describe('oauth2 helpers', () => {
'04aa106279f5977f59f9067fa9712afc4aedc6f5862a8defc34552d8c7206393'
);
});

it('should return expected hash for an empty string', async () => {
const out = await sha256('');
const hexed = hex(out);

// https://www.scivision.dev/sha256-hash-empty-file/
expect(hexed).toBe(
'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
);
});
});

describe('getCodeChallenge', () => {
Expand Down

0 comments on commit 58948c0

Please sign in to comment.