-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
27 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { mockManager, mockEvent } from "./mocking"; | ||
import { sha256 } from "./utils"; | ||
import { mockManager, mockEvent } from "../mocking"; | ||
import { sha256 } from "../utils/hashing"; | ||
|
||
export { mockManager, mockEvent, sha256 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { mockManager, mockEvent, sha256 } from "./2024-09-19"; | ||
import { mockManager, mockEvent } from "./mocking"; | ||
import { sha256 } from "./utils"; | ||
|
||
export { mockManager, mockEvent, sha256 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Coming soon... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,39 @@ | ||
import { describe, it, expect } from 'vitest'; | ||
import { sha256 } from './utils'; | ||
import { sha256 } from './hashing'; | ||
|
||
describe('sha256', async () => { | ||
it('should hash an input', async () => { | ||
const input = 'hello'; | ||
const input = '[email protected]'; | ||
const output = await sha256(input); | ||
expect(output).toBe( | ||
'2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824' | ||
'fed93bd41b367d435f8cab3e68285d5141c1207b38ee3a69610aadc74fdcec1e' | ||
); | ||
}); | ||
|
||
it('should hash an input after lowercasing', async () => { | ||
const input = 'Hello'; | ||
const input = '[email protected]'; | ||
const output = await sha256(input, true); | ||
expect(output).toBe( | ||
'2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824' | ||
'1753bdb368271a785887ddbfb926164f2f7c6a88f609c07ff0401c5572955206' | ||
); | ||
}); | ||
|
||
it('should hash an input without lowercasing', async () => { | ||
const input = 'Hello'; | ||
const input = '[email protected]'; | ||
const output = await sha256(input, false); | ||
expect(output).toBe( | ||
'185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969' | ||
'fed93bd41b367d435f8cab3e68285d5141c1207b38ee3a69610aadc74fdcec1e' | ||
); | ||
const output2 = await sha256(input); | ||
expect(output2).toBe( | ||
'185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969' | ||
'fed93bd41b367d435f8cab3e68285d5141c1207b38ee3a69610aadc74fdcec1e' | ||
); | ||
}); | ||
|
||
// it should return a string | ||
it('should return a string', async () => { | ||
const input = 'hello'; | ||
const output = await sha256(input); | ||
expect(typeof output).toBe('string'); | ||
}); | ||
}); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { sha256 } from "./hashing"; | ||
|
||
export { sha256 }; |