@akashrajpurohit/utils
    Preparing search index...

    Function maskString

    • Mask a string with a specified character

      Parameters

      • string: string

        The string to mask

      • maskLength: number

        The length of the string to mask

      • mask: string = '*'

        The character to use for masking. Default is '*'

      Returns string

      The masked string

      maskString('1234567890', 6) // '******7890'
      
      maskString('1234567890', 6, 'x') // 'xxxxxx7890'
      
      maskString('12345', 6) // '*****'