Hash a string using one of the available algorithms.
A hash is basically a signature version of a string. A string will always encode to the same hash, given the same algorithm.
However, it is impossible to decode, it is a one way encoding. Since a string will always encode to the same hash, a popular attack to attempt to find the original value is finding the hash in a rainbow table, a list of strings and their encoded equivalent. For this reason, most people add a random salt to their string before hashing, this makes rainbow tables useless, because you would need a complete list generated for your particular salt which should be unique to each hash.
The pseudo-random data is generated by node.js Crypto module. This is a good thing, because for example: most random number generator are based on time, and if you know when the number was generated, there's a good chance that you can also know what is it (or predict a future generation). In this case, the randomness comes from "noise" gathered from various hardware events, such as a hard drive working or a mouse moving.