Does anyone know please, of a permutation algorithm to use in Rev scripting, which I need for this

Looking at the word permutation in Wikipedia, it seems there are a few variations of meaning.
I'm referring to the more common meaning, whereby if you have say numbers 1,2,3,4 and 5 then the algorithm would supply 13245, 13425...53241, i.e all possible combinations of the five numbers (or letters, even) as position. It would have to be self-contained in as much as it could be used with any number of letters or numbers in the set, i.e 376894 or sjyrtkjuh.
I've tried for a while to suss this but without any success; also I found C++ algorythms on the web, etc which I was unable to "translate"; I require a Basic Rev type, of course.
Any help here appreciated, thank you!
