Skip to content

Breaking changes for the next major release #129

@axic

Description

@axic

(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 into toArrayLike and 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 in MPrime.split() and is complex.
  • Remove internal functions from the BN context (good candidates are: _countBits, _zeroBits, etc. Others could be moved too with passing a self variable 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 renamed isetn as it is in-place), testn, maskn, bincn

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions