encrypt method
String
encrypt({
- required Map data,
- required DatabaseMiniGeneralLibraryBaseOptions databaseMiniGeneralLibraryBaseOptions,
Implementation
String encrypt({
required Map data,
required DatabaseMiniGeneralLibraryBaseOptions
databaseMiniGeneralLibraryBaseOptions,
}) {
if (databaseMiniGeneralLibraryBaseOptions.isUseCrypto) {
try {
return databaseMiniGeneralLibraryBaseOptions.crypto
.encrypt(data: json.encode(data));
} catch (e) {
if (databaseMiniGeneralLibraryBaseOptions.isIgnoreError == false) {
rethrow;
}
return "";
}
} else {
try {
return json.encode(data);
} catch (e) {
if (databaseMiniGeneralLibraryBaseOptions.isIgnoreError == false) {
rethrow;
}
return "";
}
}
}