How to use the pad function from bn.js

Find comprehensive JavaScript bn.js.pad code examples handpicked from public code repositorys.

77
78
79
80
81
82
83
84
85
86
  if (natlen === opts.size) {
    buf = buf;
  } else if (natlen > opts.size) {
    buf = BN.trim(buf, natlen);
  } else if (natlen < opts.size) {
    buf = BN.pad(buf, natlen, opts.size);
  }
} else {
  hex = this.toString(16, 2);
  buf = new Buffer(hex, 'hex');
fork icon0
star icon3
watch icon3