How to use the trim function from bn.js

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

75
76
77
78
79
80
81
82
83
84
  buf = new Buffer(hex, 'hex');

  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 {
fork icon0
star icon3
watch icon3