shortenHex

Shortens a hexadecimal string without performing any validation or checksumming.

Example

import { shortenHex } from "thirdweb/utils";
shortenHex("0xa0cf798816d4b9b9866b5330eea46a18382f251e");
//=> '0xa0cf...251e'
function shortenHex(hex: string, length: number): string;

Parameters

The hexadecimal string to shorten.

Type

let hex: string;

The number of characters to keep from the start and end of the string.

Type

let length: number;

Returns

let returnType: string;

The shortened hexadecimal string.