We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f005ae commit a00c580Copy full SHA for a00c580
src/utils/format.ts
@@ -1,9 +1,9 @@
1
import { multiaddr } from '@multiformats/multiaddr';
2
3
export const multiaddrHexToHuman = (hexString: string): string => {
4
- if (hexString.substr(0, 2) !== '0x') return hexString;
+ if (hexString.substring(0, 2) !== '0x') return hexString;
5
let res: string;
6
- const buffer: Buffer = Buffer.from(hexString.substr(2), 'hex');
+ const buffer: Buffer = Buffer.from(hexString.substring(2), 'hex');
7
try {
8
res = multiaddr(new Uint8Array(buffer)).toString();
9
} catch {
0 commit comments