public static function add($uID, $type, $singeHashAllowed = false, $hashLength = 64)
    {
        self::removeExpired($type);
        $hash = self::generate($hashLength);
        $db = Database::connection();
        if ($singeHashAllowed) {
            $db->executeQuery("DELETE FROM UserValidationHashes WHERE uID = ? AND type = ?", array($uID, $type));
        }
        $db->executeQuery("insert into UserValidationHashes (uID, uHash, uDateGenerated, type) values (?, ?, ?, ?)", array($uID, $hash, time(), intval($type)));

        return $hash;
    }