Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i set encoded string to Class Variable? #6

Open
VishalChauha opened this issue Jul 25, 2018 · 1 comment
Open

How can i set encoded string to Class Variable? #6

VishalChauha opened this issue Jul 25, 2018 · 1 comment

Comments

@VishalChauha
Copy link

I have implemented code but when i try to return encoded string in external function. It says 'Undefine'.
i can got encoded string withing Callback method but i cannot use out of that scope.
Please guide.
Thanks

@dev1BD
Copy link

dev1BD commented Jul 25, 2018

I got same problem

getencrptedData() {
       let encrypt = "";
       Des.encrypt("Devloper is a good developer", "ABCDEFGH", function (encrypted) {
           const data = encrypted;
           encrypt = data;
       }, function (error) {
           console.log("Encrption error: " + error);
       });
       console.log("Encrypt Data: " + encrypt); // I want encrypted string here.
   }

I created custom function to get encrypted string but Encrypt Data returns before callback function executed.

I need encrypted string out of scope and after call back executed.
Thank You

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants