Thanks to visit codestin.com
Credit goes to github.com

Skip to content

【bug】size is no use in new BitArray(size, hex) #11

Description

@valaxy

see code in line 18 in https://github.com/bramstein/bit-array/blob/master/lib/bit-array.js

if (hex.length * 4 > this.length) {
    throw 'Hex value is too large for this bit array.'
} else if (hex.length * 4 < this.length) {
    // pad it
    while(hex.length * 4 < this.length) {
        hex = '0' + hex;
    }
}

what this.length is about? is it undefined?
well, this causes size do nothing when new BitArray(size, hex)

test in chrome, or maybe this is only for nodejs module?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions