http://pastebin.com/nv1NpRKY
there are also instructions at the end of this script page.
Hope it helps =)
EDIT:
It has troubles with big checksums. Seems like on GS does truncation with 64bits numbers.
If you want to use for production(which is not recommended), the temporary bag can be a good option, because it has small checksums (and avoid dbparam usage).
You can check those problems with gemmed items, due they have big checksums.
I'm gonna try to fix it soon.
EDIT:
tested with 2.4,
1.X shouldn't work