Give and receive constructive feedback from your fellow campers on Algorithm Challenge solutions, Frontend and Backend projects
await
next to the dbGetUserByUsername
call aswell hehe
<Android Development>
My folder and and file not exist in the local storage. I made a helper to create a directory in phone storage. But it Works on Samsung J2 but not the rest.
My Helper : https://gist.github.com/johnmelodyme/c2e1d648df216fe0f168d0985418f4d7
if (FileHelper.saveToFile(readMessage)) {
Toast.makeText(MainActivity.this, "Saved to " + Environment.getExternalStorageDirectory() +
"/Brainwave/"
+ FILE_NAME,
Toast.LENGTH_LONG)
.show();
Log.d(TAG, "Data Saved");
} else {
// something something;
}
Am I doing it wrong ?
import "package:encrypt/encrypt.dart";
import "dart:convert";
class monjo_encryption {
static int theKeyLength = 32;
static int theLengthOfInitialisationVector = 16;
static var key = Key.fromLength(theKeyLength);
static var iv = IV.fromLength(theLengthOfInitialisationVector);
static var AESENCRYPTOR = Encrypter(AES(key));
// AES-Symmetric, padding: random
encrypt_string(String sendMessage) {
var encrypted = AESENCRYPTOR.encrypt(sendMessage, iv:iv);
String encryptedHashes = encrypted.base64;
decrypt_string(encrypted);
return encryptedHashes;
}
decrypt_string(var encrypted) {
var decrypted = AESENCRYPTOR.decrypt(encrypted, iv:iv);
String DecryptedHashes = decrypted;
return DecryptedHashes;
}
}
void main () {
monjo_encryption test = new monjo_encryption();
var a = test.encrypt_string("hahslkjdflkjsdflksjdflksjdfslkdfjsldkfjah");
List <int> b = utf8.encode(a);
print(a);
print(b);
}