Skip to content

Commit

Permalink
Create isSHA256 function
Browse files Browse the repository at this point in the history
  • Loading branch information
Huseyn Mikayilov committed Aug 26, 2023
1 parent b958bd7 commit 0131b5f
Showing 1 changed file with 8 additions and 0 deletions.
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 14

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 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 14

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 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);
}

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

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 14

Newline required at end of file but not found

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

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 12

Newline required at end of file but not found

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

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 10

Newline required at end of file but not found

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

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 8

Newline required at end of file but not found

0 comments on commit 0131b5f

Please sign in to comment.