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

Add "type"="module" to package.json to treat .js files as ES modules #6

Merged
merged 2 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
.DS_Store
node_modules
dist
42 changes: 42 additions & 0 deletions dist/bcrypt-edge.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* Synchronously generates a salt.
* @param rounds Number of rounds to use, defaults to 10 if omitted
* @returns Resulting salt
*/
declare const genSaltSync: (rounds?: number) => string;
/**
* Synchronously generates a hash for the given string.
* @param s String to hash
* @param salt Salt length to generate or salt to use, default to 10
* @returns Resulting hash
*/
declare const hashSync: (value: string | Buffer, salt?: string | number) => string;
/**
* Synchronously tests a string against a hash.
* @param s String to compare
* @param hash Hash to test against
* @returns true if matching, otherwise false
* @throws If an argument is illegal
*/
declare const compareSync: (value: string | Buffer, hash: string) => boolean;
/**
* Gets the number of rounds used to encrypt the specified hash.
* @param hash Hash to extract the used number of rounds from
* @returns Number of rounds used
* @throws If `hash` is not a string
*/
declare const getRounds: (hash: string) => number;
/**
* Gets the salt portion from a hash. Does not validate the hash.
* @param hash Hash to extract the salt from
* @returns Extracted salt part
* @throws If `hash` is not a string or otherwise invalid
*/
declare const getSaltSync: (hash: string) => string;
declare const _default: {
compareSync: (value: string | Buffer, hash: string) => boolean;
getRounds: (hash: string) => number;
genSaltSync: (rounds?: number | undefined) => string;
hashSync: (value: string | Buffer, salt?: string | number | undefined) => string;
};
export { _default as default, genSaltSync, hashSync, compareSync, getRounds, getSaltSync };
8 changes: 8 additions & 0 deletions dist/bcrypt-edge.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "bcrypt-edge",
"version": "0.0.3",
"type": "module",
"module": "dist/bcrypt-edge.js",
"types": "dist/bcrypt-edge.d.ts",
"description": "Bcrypt implementation specifically for web workers",
Expand Down
Loading