Accueil → WINDEV 26 → String into binary in WinDev
String into binary in WinDev
Débuté par Albina, 26 mai 2022 08:54 - 4 réponses
Posté le 26 mai 2022 - 08:54
Hello everyone,

According to WinDev help this should provide me with binary of the string. Am I right?

sRaw is string = Encrypt(sHash, "", encodeNone)

But it doesn't. Why? ;(
Posté le 26 mai 2022 - 13:59
Problem solved, topic can be closed/deleted.
Posté le 26 mai 2022 - 17:53
Im nto sure what you are trying to do, but your options combination is curious...

You are not defining the encryption type, so the default FAST is used
BUT you are not giving a password, so the encryption has nothing to work with

As for you original question, first if you want to get a binary return, use a buffer for the result variable or you will loose data, second, I'm guessing that you are not getting a binary value simply because you are not goving a password to the function, so it cannot encrypt the string, and if it dioes not encrypt the string, the option of choosing hwo the encrypted string is returned becomes moot.
Posté le 31 mai 2022 - 09:03
Thank you for your responce.

You're right about buffer, I found it the same day when I post my question. But then my research suddenly stopped as I succeded to get what I needed :D I had to construct encryption method similar to the example in node js and finally did it.

I have another question about http request, can i contact you, if this is ok?
Membre enregistré
6 messages
Posté le 17 juin 2022 - 14:03
I'm assuming this is a homework assignment, so you shouldn't rely on bin or b-format.

Your biggest problem is that your int_to_reverse_binary function is implemented incorrectly. The instruction is clear, and in fact gave you a line-by-line break down of what you should be writing:

def int_to_reverse_binary(x): # For an integer x
output = "" # (initialize)
while x > 0: # As long as x is greater than 0...
output += str(x%2) # ... output x%2
x = x//2 # ... x = x//2
return output # (return your result)
After that in the reverse function, you need to capture the output from the function!

def string_reverse(input_string):
reversed_output = int_to_reverse_ https://shagle.download binary(integer_value)
return https://voojio.com/chatroom/omegle reversed_output[::-1]
Message modifié, 17 juin 2022 - 14:04