You might look at using the Random class.
Or if you don't want to use the Random class you could take the NodeID
+ DocumentID
x NodeOrder
and generate a somewhat random number.
Of if you don't need a number, you could use the NodeGuid
for that particular node.