I've been using your fixm50to50 in my Kit Generator script.
I was trying to reverse the functionality as in supplying an integer and returning a hex string. However i failed to reverse the function because it has some byteshift code that eludes me.
Any ideas ?
Check out the Multi-sample Kit Creator for Deluge