-
Notifications
You must be signed in to change notification settings - Fork 6
Use SHA-256 hashing #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Use SHA-256 hashing #123
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
816c3f0
Remove the js-md5 package
kienstra 8b5a08f
Remove needless eslint-disable comment
kienstra 36d42d6
Move the empty string case to the top of the tests
kienstra cf1ba3e
Add another test case for getHash()
kienstra 439e876
Use a different library for SHA-256
kienstra eb279f6
Remove jssha package that we're not using anymore
kienstra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -6,11 +6,9 @@ interface SaveCache { | |
// See https://circleci.com/docs/2.0/configuration-reference/ | ||
interface FullStep { | ||
checkout?: Record<string, unknown> | string; | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is already ignored in |
||
attach_workspace?: { | ||
at: string; | ||
}; | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
persist_to_workspace?: { | ||
root: string; | ||
paths: Array<string>; | ||
|
@@ -39,7 +37,6 @@ type Step = FullStep | string | 'checkout'; | |
interface Job { | ||
docker?: Array<Record<string, string>>; | ||
steps?: Step[]; | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
working_directory?: string; | ||
machine?: { image?: string }; | ||
} | ||
|
This file contains hidden or 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 hidden or 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,29 @@ | ||
import * as assert from 'assert'; | ||
import getHash from '../../../utils/getHash'; | ||
|
||
suite('getHash', () => { | ||
test('empty string', () => { | ||
assert.strictEqual( | ||
getHash(''), | ||
'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' | ||
); | ||
}); | ||
|
||
test('possible machineId 1', () => { | ||
assert.strictEqual( | ||
getHash( | ||
'a923bcf3da6acff9c9bf4f129135ffd56adbfa294aeb8117c7264164c1a9382ca' | ||
), | ||
'ea5320a945bfe117f3d9ee12268734180b697913fb7ff498549a5bb201255b09' | ||
); | ||
}); | ||
|
||
test('possible machineId 2', () => { | ||
assert.strictEqual( | ||
getHash( | ||
'52ab60b09f4e8fae2bcb8ac38871cfa8613ee4a1d566dcec5659e320148dc366e' | ||
), | ||
'f600f144c3c96701f3c34ddd9fb65089af27fb8264fcba12f40af8d6cbbddeeb' | ||
); | ||
}); | ||
}); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,5 @@ | ||
import { sha256 } from 'cross-sha256'; | ||
|
||
export default function getHash(toHash: string): string { | ||
return new sha256().update(toHash).digest('hex'); | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't supported anymore, it seems