protected static function mask($subject, $mask)
    {
        if ($mask === null) {
            return $subject;
        } elseif ($mask === '') {
            return '';
        }

        $result = str_split($subject);
        foreach ($result as $id => $value) {
            $char = $mask[$id];
            if ($char !== static::MOVEMENT_MASK_CHAR) {
                $result[$id] = $char;
            }
        }

        return implode('', $result);
    }