byte-utils.ts 334 Bytes
Newer Older
Kelvin Fichter's avatar
Kelvin Fichter committed
1 2 3 4 5 6 7
export const makeHexString = (byte: string, len: number): string => {
  return '0x' + byte.repeat(len)
}

export const makeAddress = (byte: string): string => {
  return makeHexString(byte, 20)
}
Kelvin Fichter's avatar
Kelvin Fichter committed
8 9 10 11 12 13 14 15

export const remove0x = (str: string): string => {
  if (str.startsWith('0x')) {
    return str.slice(2)
  } else {
    return str
  }
}