MD5 calculation

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
skahlhoefer
Posts: 12
Joined: 02 Dec 2013 22:35

MD5 calculation

Post by skahlhoefer » 02 Dec 2013 22:42

Hi Martin,
congrats to your exiting and valuable work!
I really would like to perform automated HTTP requests against my Fritz.Box. Therefore I have to calculate a md5 hash which I couldn't find to realize in the script action.
Could you please add a function which calculates this hash out of a given string please? Hope that Android already supports such function so it's not too hard work.
Thanks in advance for your help!
Stefan

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: MD5 calculation

Post by Martin » 03 Dec 2013 16:59

Hi,

Android internally supports MD5 and some other algorithms, adding an action or script function to do this should be possible.
Can you post a link to an example of such a request? What data needs to be MD5ed, a local variable or a file?

Regards,
Martin

skahlhoefer
Posts: 12
Joined: 02 Dec 2013 22:35

Re: MD5 calculation

Post by skahlhoefer » 03 Dec 2013 17:29

Hi Martin,

thanks for answering quiet fast.
According to the attached notes from AVM a string which I get via HTTP request before and save in a local variable has to be hashed.
http://www.avm.de/de/Extern/files/sessi ... ion_ID.pdf
I have some function in mind that looks like
hash = md5 ( string )

Cheers
Stefan

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: MD5 calculation

Post by Martin » 06 Dec 2013 09:58

Hi,

I've added a new script function hash to the next version (test version available in the EAP forum).
You can specify the algorithm (MD5) and the encoding used to convert the string to bytes.

The function call for FritzBox probably needs to look like this:
hashsum = hash("1234567z-äbc", "UTF-16LE", "MD5");
which should return the string 9e224a41eeefa284df7bb0f26c2913e2

Regards,
Martin

skahlhoefer
Posts: 12
Joined: 02 Dec 2013 22:35

Re: MD5 calculation

Post by skahlhoefer » 06 Dec 2013 17:09

Hi Martin,

thanks a lot for implementing my request. I'm very exited about your extremely fast response and solving time. All thumbs up for this and I will try the new test app immediately! :-)

Enjoy your weekend!
Stefan

skahlhoefer
Posts: 12
Joined: 02 Dec 2013 22:35

Re: MD5 calculation

Post by skahlhoefer » 08 Dec 2013 21:55

Function works fine. I successfully implemented my wanted functionality (switching FritzBox smart home device on and off).

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: MD5 calculation

Post by Martin » 09 Dec 2013 17:44

Great, thanks for testing!

S.M.T
Posts: 15
Joined: 24 Aug 2019 12:11

Re: MD5 calculation

Post by S.M.T » 25 Aug 2019 19:57

skahlhoefer wrote:
08 Dec 2013 21:55
Function works fine. I successfully implemented my wanted functionality (switching FritzBox smart home device on and off).
Hallo skahlhoefer,
das hört sich gut an. Wie muss der Flow/Code dazu aussehen?
Ich suche und probiere schon seit Tagen nach einer Lösung.
Gruß Sebastian

Edit: Lösung = viewtopic.php?f=5&t=8227

Locked