calvinmetcalf / crypto-pouch

plugin for encrypted pouchdb/couchdb databases
MIT License
243 stars 43 forks source link

RangeError: Trying to access beyond buffer length(…) #20

Closed senthil7273 closed 3 years ago

senthil7273 commented 8 years ago

here is code used to enable crypto in pouchDB. I am using cordova+angularjs+pouchdb. i tried the same on chrome too.

var password = "xxx";
  thisObj._db = new PouchDB('myDatabase', {adapter: 'websql'});
   thisObj._db.crypto(password)
  .then(function(){
  });

when i tried to put a record as mentioned below

thisObj._db.put({_id:'s1', name:'senthil', offline:'yes'}).then(function(response){
    console.log(response);
  }).catch(function(error){
    console.log(error);
  });

i am getting the follwing error. RangeError: Trying to access beyond buffer length(…)

Am i missing anything ? or doing in wrong way ?

garbados commented 3 years ago

Hi @senthil7273 ! Do you still need help with this? We just published version 4.0 and I invite you to try again with it. I'm closing this issue for now since it's been a while, but I can re-open if you'd like :)