I was working on an old Advent of Code problem and it required calculating an MD5 hash so I decided to lookup how to create one and by a LOT of trial and error (had to re-get my head around little and big endianness) I created a pure SnapI version
It does contain some binary/hexadecimal conversion reporters that might be useful in other projects
[edit 05Oct2022 to handle empty or single char input]
[edit 05Oct2022 - 9 times speed up by removing unnecessary number base conversions ]
[edit29Oct2022 When trying another AOC puzzle, I needed to iterate over 26million strings and calculate their hashes and my native Snap! implementation just wasn't anywhere near fast enough
So I used a JS implementation from GitHub and made a reporter using it.
what's wrong with programming in the language that the ide expects you to program in?
wouldn't that sort of be "cheating"?
And even it is,the advent of code cannot see what you are doing offline
This is not a CSP-J test
well personally i'd feel more proud of myself if i implemented an MD5 hash myself rather than sending a request to some website to deal with it.
If I try to convert a one-letter string to MD5 hash, I get this:
if you aren't actually creating the thing yourself, what's the point of doing the advent of code?
it's like giving yourself a math test and just putting every question into wolfram
I meant to use Python for hashing
Thanks for trying that
I'd over-optimised that map function and it didn't handle empty or single chars anymore
I've reverted it back to the previous code that definitely produces a list
isn't 3 languages a bit much? this is just an md5 hash.
i feel like you would have more code just for running other code than to actually do the task
it's generally best practice in programming to try and keep things simpler, it's difficult to work with something that's in many different languages in many different places.
i was just taking a joke on this,and trying to convince you to use 8 nested backslashes and quotes(you double the number of back slashes for every language)