Closed deadlyfingers closed 8 years ago
Updated encode method:
var URLSafeBase64 = {
encode: function(string) {
return encodeURIComponent(btoa(string).replace(/=+$/, ''));
},
decode: function(base64) {
return atob(decodeURIComponent(base64));
}
};
There seems to be a '-' in the (URL safe) Device Identity which can cause issues as I use this as a PouchDB Id delimiter.
Possible fixes:
lastIndexOf('-')
use second index of '-'.NB: using '.' as url safe character might cause issues if it produces two consecutive dots in the URL.