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

Create isSHA256 function #2277

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions src/lib/isSHA256.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import assertString from "./util/assertString";

Check failure on line 1 in src/lib/isSHA256.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 12

Strings must use singlequote

Check failure on line 1 in src/lib/isSHA256.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 10

Strings must use singlequote

Check failure on line 1 in src/lib/isSHA256.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 8

Strings must use singlequote

const sha256 = /^[a-f0-9]{64}$/;

export function isSHA256(str) {

Check failure on line 5 in src/lib/isSHA256.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 12

Prefer default export on a file with single export

Check failure on line 5 in src/lib/isSHA256.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 10

Prefer default export on a file with single export

Check failure on line 5 in src/lib/isSHA256.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 8

Prefer default export on a file with single export
assertString(str);
return sha256.test(str);
}
Loading