Changes the way of generate random int and ensures the \n character removed is at the end of the token.
Ensures to remove urls trailing slash and validates cp code.
Implements du helper for easier usage.
Validates that params and action exist.