brodycj / cordova-sqlite-ext

A Cordova/PhoneGap plugin to open and use sqlite databases on Android/iOS/macOS/Windows with REGEXP (Android/macOS/iOS) and pre-populated databases (Android/iOS/macOS/Windows)
Other
72 stars 55 forks source link

INSERT BLOB data from Base64 #52

Open brodycj opened 7 years ago

brodycj commented 7 years ago

This version already has the BASE64 function which can be used to SELECT BLOB data in Base64 format. This works well with the internal JSON interface as well as some important JavaScript libraries.

It would also be nice to be able to INSERT BLOB data from a Base64 value. This would involve adding another user defined function such as FROMBASE64 or BLOB_FROM_BASE64 which would basically decode a Base64 value.

Just like the BASE64 function uses a modified version of cencode.c from http://libb64.sourceforge.net/ (see https://github.com/brodybits/sqlite3-base64) the new FROMBASE64 function would probably use a possibly modified version of cdecode.c from http://libb64.sourceforge.net/.