-
Notifications
You must be signed in to change notification settings - Fork 154
Open
Labels
Description
(Taking the discussion from #112 to here)
Proposed changes:
- Make
.modn()return a BN (modn API inconsistency #112) - Renaming
.strip()to._strip()is a breaking change too (readme: document strip() and toJSON() #105) - Maybe reviewing the constructor method(s) could lead to such a change (see Bug in parseBase for numbers containing a dot ('0.0079') #90 & Reject decimal input #91)
- Rename
.andln()to.andn()(see the README). Perhaps fold the functionality intotoArrayLikeand make.andn()safe in terms of working up to 53 bits - Maybe at that stage two's complement could be made more internal (part of constructor and toString) (see Feature request: two's complement #73)
- Split out the extended functions (saving destroyed bits) off
iusrhn()into a specific shift right version, because it is only used inMPrime.split()and is complex. - Remove internal functions from the BN context (good candidates are:
_countBits,_zeroBits, etc. Others could be moved too with passing aselfvariable instead of using this, however that might have a speed penalty or increase?) - Perhaps rethink naming/functionality of the following bitwise methods:
setn(should be renamedisetnas it is in-place),testn,maskn,bincn
Reactions are currently unavailable