Sorry if the title is confusing, but here's an example to illustrate what I'm trying to accomplish.
I would like to create a 'checksum' or ID grouping of similar number sequences, so that when you compare one sequence to another, it can see if they are similar or not. 'Similar' sequences here are sequences that are shifted to the right or left, but maintain their pattern. This is a similar sequence:
[ 1, 4, 5, 6 ]
[ 4, 5, 6, 1 ]
[ 5, 6, 1, 4 ]
[ 6, 1, 4, 5 ]
As you can see in each set of numbers the sequence is shifted to the left. So in this example:
sumof([ 1, 4, 5, 6 ]) == sumof([ 4, 5, 6, 1 ]);
But
sumof([ 1, 4, 4, 6 ]) != sumof([ 4, 5, 6, 1 ]);
Another way to put it is:
$checksum == sumof([ 1, 4, 5, 6 ]) == sumof([ 4, 5, 6, 1 ]) == sumof([ 5, 6, 1, 4 ]) == sumof([ 6, 1, 4, 5 ])
I would like the function sumof() to create an alphanumeric value of the sum/checksum of the sequence (preferably an integer, but can contain characters too). Like hashes, I want this value to be robust enough to prevent any collisions with non-matching sequences.
I hope I've described this well enough. If you need any clarification please ask in the comments.