Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 20, 2013 5:51:13 GMT 1
I would like to invite the BaCon project to a BASIC MD5 code challenge being hosted on the BASIC programming forum. The goal to create a MD5 routine in BASIC only. Tomaaz mentioned that he might submit a BaCon entry but I don't know if that still stands. RULES1. The MD5 routine must be coded in BASIC. 2. Calling precompiled MD5 libraries (static or dynamic) or helper functions is prohibited. 3. BASIC compilers, translators and interpreters are welcome. 4. The winner will be chosen based on creativity, code size, speed and educational value.
|
|
|
Post by vovchik on Jun 20, 2013 9:46:47 GMT 1
Dear jrs, Some time ago I needed an MD5 routine in order to generate proper thumbnails (stored in $HOME/.cache/thumbnails) for Pikona, an icon generator I once wrote. After hand-coding a routine, which proved long and arduous, I came up with a tiny solution that made use of libssl www.basic-converter.org/md5.bac.html. I don't have the sources here for my long-hand attempt, but in a few weeks I will be back at that old computer (in another country) and try to find it. There are a number of BASIC implementations around, and all rely on bit-shifting (which BaCon can do). I'm interested in seeing what people come up with.... With kind regards, vovchik
|
|
|
Post by bigbass on Jun 20, 2013 14:21:21 GMT 1
echo -n "Simplicity is the ultimate sophistication." | md5sum
Leonardo da Vinci
|
|
|
Post by Pjot on Jun 20, 2013 16:30:30 GMT 1
Hi jrs, This looks like a nice challenge for me - but what is the prize? Eternal fame or some real pennies? Thx, Peter
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 20, 2013 19:14:44 GMT 1
The master of the universe comes to mind.
|
|
|
Post by Pjot on Jun 24, 2013 20:24:35 GMT 1
Hmpf, "master of the universe", that doesn't mean a lot to me Anyway, my MD5 program is ready. As agreed in the contest I will wait with publishing the code until July 4. Forum members who cannot wait to see the MD5 program in BaCon, pls send me a PM and I will send a PM back with the code. Saludos cordiales
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 24, 2013 20:31:49 GMT 1
Thank you Peter for participating and helping clear the air.
|
|
|
Post by Pjot on Jun 24, 2013 20:36:20 GMT 1
No problem - pls see the other forum for details on my contribution. BR, Peter
|
|
|
Post by alexfish on Jun 25, 2013 0:28:10 GMT 1
bowing out of this one.
It could be done using Bacon + Hug as is, there for could also have niece gui..
at present do not have a system with the neccesary bit as in >=
did try to upgrade one system , so far met with total failure , a curse to some linux distro's.
Have fun
Alex
|
|
|
Post by alexfish on Jun 25, 2013 21:48:13 GMT 1
Bowing back in have done initial code using BaCon + Hug Only. Initial test shows alexfish@alexfish-desktop ~/Desktop/bacon $ ./test Result = 144052224 MD5 test string `Bacon Conveter` : 831d956ae44765d859b8409c954083d9
Will Post gui version later , as an exec only .. Have fun Alex Edit . looks like I made a Typo in the test code:: but leaving the above as is See further Posts did a quick test of the posted exec , using bacon GUI , loaded bacongui.bac then copy all the paste all to the text2MD5.. the checksum shows as f0b8a94ec5fcf59af745d13e6720ea92 Bacon Forum members:: please send me a PM and I will send a PM back with the code.
|
|
|
Post by alexfish on Jun 25, 2013 23:54:26 GMT 1
Hi All Bacon text to MD5 32bit , upx'ed A Massive 42KB of code including the UI Have Fun Alex Attachments:
|
|
|
Post by alexfish on Jun 26, 2013 0:53:25 GMT 1
Hi All screen shot of the Text 2 MD5 Showing that I made a typo in the first Demo ,,, BR Alex Attachments:
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 26, 2013 6:31:05 GMT 1
Thanks for the contribution and effort!
|
|
|
Post by vovchik on Jun 26, 2013 8:29:53 GMT 1
Dear Alex,
It works nicely. Well done.
With kind regards, vovchik
|
|
|
Post by alexfish on Jun 26, 2013 21:51:21 GMT 1
hey Vovchik , Have done a newer GUI version with independant Timer , IE not of Bacon origin but of what is available in Hug the computed time for Bacongui.bac Md5checksum is :: 8410 lines of code in 0.00229 seconds IE 2.29 mil sec this is on a dual core Intel Atom , therefore think think Bacon + Hug checksum , quite impressive.. Whilst we can boast speed . much depends on your Kernel + your system therefore think timing should be voided .. But would like to see Peters result for same .. BR + Thanks to all Alex Timer Code ' The Import lines for a timer RE:: Hug.bac Requires Glib >= 2.4 IMPORT "g_timer_new()" FROM HUGLIB$("glib") TYPE long IMPORT "g_timer_start(long)" FROM HUGLIB$("glib") TYPE void IMPORT "g_timer_stop(long)" FROM HUGLIB$("glib") TYPE void IMPORT "g_timer_continue(long)" FROM HUGLIB$("glib") TYPE void IMPORT "g_timer_destroy(long)" FROM HUGLIB$("glib") TYPE void IMPORT "g_timer_elapsed(long)" FROM HUGLIB$("glib") TYPE double
REM ......Typical Code.......
SUB DO_MY_SUB()
LOCAL elapsed TYPE double LOCAL timer timer = g_timer_new() g_timer_start(timer)
' DO WHAT EVER CODE HERE ' Blagh Blag FU ' end of What ever
elapsed=g_timer_elapsed(timer) PRINT elapsed g_timer_stop(timer) g_timer_destroy(timer)
END SUB TO FIND libc Number .. From the terminal ldd --version the libs went from 2.2 to 2.* .. = early versions Then went 2.1* .. which are later versions
|
|