Thanks for sharing the code, looks to me like some sort of check-sum style algorithm but without strong crypto (military grade, HA).
Adding 1 to version and -11111 to quote results in the same result from what I can see, not where the key has 0 in it though. It's week, have you found anything else?