2017-03-01 58 views

回答

0

您可以使用nedb掛鉤afterSerializationbeforeDeserialization加密&解密數據

例如:

var db = new Datastore({ 

    filename : path.join(__dirname, 'data/anything.db'), 
    autoload: true, 
    afterSerialization: function (doc) { 
      // encription usig AES or any algo 
    }, 

    beforeDeserialization : function(doc) { 
     // encription usig AES and or algo with same key 
     return doc; 
    } 
});