Generates a random string and returns them or sends it to callback.
Great for generating unique identifiers.