Function formatHash

Formats given input string, taking first sideCharsLength and last sideCharsLength characters, joining them with separator. If there is not enough characters, returns the original string.

formatHash("abcdef1234567890") // "abcd…7890"
  • Parameters

    • hash: string
    • sideCharsLength: number = DEFAULT_SIDE_CHARS_LENGTH
    • separator: string = "…"

    Returns string