File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
1
const crypto = require ( 'crypto' )
2
2
const babelJest = require ( 'babel-jest' ) . default
3
+
4
+ // get FIPS status and set hash algorithm accordingly
5
+ const isFips = crypto . getFips ? crypto . getFips ( ) : false
6
+ const hashAlgorithm = isFips ? 'sha256' : 'md5'
7
+
3
8
module . exports = {
4
9
process : require ( './process' ) ,
5
10
getCacheKey : function getCacheKey (
@@ -8,7 +13,7 @@ module.exports = {
8
13
{ config, configString, instrument, rootDir }
9
14
) {
10
15
return crypto
11
- . createHash ( 'sha256' )
16
+ . createHash ( hashAlgorithm )
12
17
. update (
13
18
babelJest . createTransformer ( ) . getCacheKey ( fileData , filename , {
14
19
config,
Original file line number Diff line number Diff line change 1
1
const crypto = require ( 'crypto' )
2
2
const babelJest = require ( 'babel-jest' ) . default
3
+
4
+ // get FIPS status and set hash algorithm accordingly
5
+ const isFips = crypto . getFips ? crypto . getFips ( ) : false
6
+ const hashAlgorithm = isFips ? 'sha256' : 'md5'
7
+
3
8
module . exports = {
4
9
process : require ( './process' ) ,
5
10
getCacheKey : function getCacheKey (
@@ -8,7 +13,7 @@ module.exports = {
8
13
{ config, configString, instrument, rootDir }
9
14
) {
10
15
return crypto
11
- . createHash ( 'sha256' )
16
+ . createHash ( hashAlgorithm )
12
17
. update (
13
18
babelJest . createTransformer ( ) . getCacheKey ( fileData , filename , {
14
19
config,
You can’t perform that action at this time.
0 commit comments