Skip to content

Commit 0cd297c

Browse files
committed
Adds compatibility with Node 4.0.0 up to 4.4.7. Buffer.from is available since 4.5
1 parent 42f4fc1 commit 0cd297c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/encrypted-attr.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const alg = 'aes-256-gcm'
44
const crypto = require('crypto')
55
const get = require('lodash').get
66
const set = require('lodash').set
7+
const Buffer = require('safe-buffer').Buffer
78

89
function EncryptedAttributes (attributes, options) {
910
options = options || {}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"orm"
1616
],
1717
"dependencies": {
18-
"lodash": "^4.17.4"
18+
"lodash": "^4.17.4",
19+
"safe-buffer": "^5.1.1"
1920
},
2021
"devDependencies": {
2122
"mocha": "^3.5.0",

0 commit comments

Comments
 (0)