MCPcopy Index your code
hub / github.com/dfinityexplorer/dfinityexplorer-dashboard / getHashString

Function getHashString

web/src/utils/getHashString.tsx:14–24  ·  view source on GitHub ↗
(hash: string, maxLength?: number)

Source from the content-addressed store, hash-verified

12 * @protected
13 */
14export default function getHashString(hash: string, maxLength?: number): string {
15 if (maxLength === undefined)
16 maxLength = 22;
17 if (maxLength !== 0 && hash.length > maxLength) {
18 const first = hash.substring(0, Math.max(maxLength - 4, 0));
19 const last = hash.substr(hash.length - 4);
20 return first + "..." + last;
21 }
22 else
23 return hash;
24}

Callers 3

getBodyRowsFunction · 0.85
getBodyRowsMethod · 0.85
getBodyRowsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected