Remove unneeded polyfill
This polyfill was added because node versions less than 10.5.0 didn't include scrypt support. As we now raised the minimum required version to 12.0.0, this polyfill isn't needed anymore. Signed-off-by: Erik Michelson <opensource@erik.michelson.eu>
This commit is contained in:
		
							parent
							
								
									09466189ad
								
							
						
					
					
						commit
						e54236d057
					
				@ -1,15 +1,6 @@
 | 
				
			|||||||
'use strict'
 | 
					'use strict'
 | 
				
			||||||
// external modules
 | 
					// external modules
 | 
				
			||||||
const Sequelize = require('sequelize')
 | 
					const Sequelize = require('sequelize')
 | 
				
			||||||
const crypto = require('crypto')
 | 
					 | 
				
			||||||
if (!crypto.scrypt) {
 | 
					 | 
				
			||||||
  // polyfill for node.js 8.0, see https://github.com/chrisveness/scrypt-kdf#openssl-implementation
 | 
					 | 
				
			||||||
  const scryptAsync = require('scrypt-async')
 | 
					 | 
				
			||||||
  crypto.scrypt = function (password, salt, keylen, options, callback) {
 | 
					 | 
				
			||||||
    const opt = Object.assign({}, options, { dkLen: keylen })
 | 
					 | 
				
			||||||
    scryptAsync(password, salt, opt, (derivedKey) => callback(null, Buffer.from(derivedKey)))
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
const scrypt = require('scrypt-kdf')
 | 
					const scrypt = require('scrypt-kdf')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// core
 | 
					// core
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user