ebceu4 / waves-crypto

Waves platform crypto primitives and binary serialization.
MIT License
0 stars 0 forks source link

code improvement #9

Closed roccomuso closed 5 years ago

roccomuso commented 5 years ago

https://github.com/ebceu4/waves-crypto/blob/master/src/index.ts#L187

    case 'Uint8Array':
      const arr = new Uint8Array(count)
      for (let i = 0; i < count; ++i) {
        arr[i] = buf.readUInt8(i)
      }
      return arr

why can't simply put:

  case 'Uint8Array':
     return Uint8Array.from(buf)
siemarell commented 5 years ago

Feel free to submit PR to https://github.com/wavesplatform/waves-crypto/