Skip to content
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

Choice of Hash Function #29

Merged
merged 28 commits into from
Jun 26, 2023
Merged

Choice of Hash Function #29

merged 28 commits into from
Jun 26, 2023

Conversation

philcockfield
Copy link
Owner

@philcockfield philcockfield commented Jun 23, 2023

Issue: #23

const cache1 = new FileSystemCache();                    // ← default: "sha1"
const cache2 = new FileSystemCache({ hash: 'sha256' });
const cache3 = new FileSystemCache({ hash: 'sha512' });

@philcockfield
Copy link
Owner Author

philcockfield commented Jun 23, 2023

@trevor-vaughan
I've added a sha256 and sha512 options.

export type HashAlgorithm = 'sha1' | 'sha256' | 'sha512';

I wonder, are there any other baseline/standard algorithms you'd like to see included?

    const cache1 = new FileSystemCache();                    // ← default: "sha1"
    const cache2 = new FileSystemCache({ hash: 'sha256' });
    const cache3 = new FileSystemCache({ hash: 'sha512' });

Please let me know if you want any others, and I'll get them in and tested, and then bump this feature release over to NPM. Thanks!

@trevor-vaughan
Copy link

@philcockfield Ideally, you'd pull the available hashes out of the underlying installation and allow for any from that list.

crypto = require('crypto')
hashes = crypto.getHashes()

@philcockfield
Copy link
Owner Author

that's better @trevor-vaughan - cheers!

@philcockfield
Copy link
Owner Author

Published as 2.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants