1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00
metamask-extension/test/lib/mock-encryptor.js
2018-10-09 09:32:48 -02:30

37 lines
607 B
JavaScript

var mockHex = '0xabcdef0123456789'
var mockKey = Buffer.alloc(32)
let cacheVal
module.exports = {
encrypt (password, dataObj) {
cacheVal = dataObj
return Promise.resolve(mockHex)
},
decrypt (password, text) {
return Promise.resolve(cacheVal || {})
},
encryptWithKey (key, dataObj) {
return this.encrypt(key, dataObj)
},
decryptWithKey (key, text) {
return this.decrypt(key, text)
},
keyFromPassword (password) {
return Promise.resolve(mockKey)
},
generateSalt () {
return 'WHADDASALT!'
},
getRandomValues () {
return 'SOO RANDO!!!1'
},
}