Ewon TechForum
Providing technical solutions to technical requests


MD5 Checksum with BASIC
FromTicket Offline
Junior Member
#1
Hi,

Is there a way to compute a MD5 checksum from the BASIC of eWON ?
Reply

simon Offline
eWON Support
#2
There is no BASIC function to do that.
However, I have found a MD5 library on the Internet to develop that in JAVA.

Since you want to use BASIC to program your eWON, I have added in the JAVA program a simple TELNET server.
The idea is to use an Internal TELNET connection to make the BASIC program communicate to the JAVA program.

So, to use it, just drop the JAVA files (See in MD5.zip) : MD5.jar, MD5.jad and jvmrun in the /usr directory of your eWON and reboot it.
Then in BASIC, use the function "OPEN" to open a socket to the eWON itself. See the below example :
Code:
A$ = @MD5$("hello")
Print A$

Function MD5$($string$)
 OPEN "tcp:192.168.120.91:333" FOR BINARY OUTPUT AS 1
$loop:
 $buf$ = GET 1
 If ($buf$="#CLOSED#") THEN GOTO $loop
 PUT 1,$string$ + CHR$(13)
 @delay%(1000)
 $Result$ = GET 1,100
 @delay%(100)
 PUT 1,"exit" + CHR$(13)
 Close 1
 $MD5$ = $Result$
EndFn

Function delay%($msec%)
$start% =GETSYS PRG,"MSEC"
$loop:
For $i%=1 To 1000
Next $i%
$now% = GETSYS PRG,"MSEC"
$delay% = $now% - $start%
If ($delay% <$msec%) Then GOTO $loop
EndFn

PS : 192.168.120.91 is the eWON LAN IP address.


Attached Files
.zip   MD5.zip (Size: 86,71 KB / Downloads: 11)
Reply



Possibly Related Threads…
18-05-2020, 05:15 PM
Last Post: simon
  String type in basic Started by khaterchi
2 Replies - 78 Views
14-05-2020, 07:19 PM
Last Post: khaterchi
12-05-2020, 09:20 AM
Last Post: simon
22-04-2020, 04:09 PM
Last Post: simon
09-03-2020, 02:29 PM
Last Post: simon
09-03-2020, 01:48 PM
Last Post: simon
07-01-2020, 03:34 PM
Last Post: simon
  Creating tags in BAsIC IDE Started by ProAuto
1 Replies - 1.212 Views
16-05-2019, 07:18 PM
Last Post: ProAuto
15-05-2019, 09:49 PM
Last Post: Bernd
22-04-2019, 07:45 PM
Last Post: dblake



Users browsing this thread:
1 Guest(s)



Theme © Ewon 2019 - Forum software by © MyBB - Cookie policy