Convert binary representation to armored and back #1397
Unanswered
AndreasGassmann
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Hi @AndreasGassmann, And again for completeness: to go from armored to binary, you can also just do |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Setup
I am encrypting a text with the following code:
This gives me a UInt8Array output, as expected.
The test values I used are:
test
secret
Problem
I would now like to convert the output above to an armored representation and back.
I tried to following code:
It seems that the first 2 logs don't work as expected, but the last one does. The output in the console in the browser is the following:
it looks like there is some kind of issue related to promises (note the "ZoneAwarePromise", this is something that Angular injects). The last line seems to be working fine. Is it possible that the
message.write()
method, which is also used internally in themessage.armor()
call, is using a promise somewhere that is not properly awaited? Or am I doing something wrong?Armored to Binary
And just for completeness, this is how I go from armored to binary, in case anyone needs this in the future. (This seems to work).
Beta Was this translation helpful? Give feedback.
All reactions