Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request to add size parameter to BitString constructor #9

Open
whus6207 opened this issue Oct 18, 2018 · 0 comments
Open

Feature request to add size parameter to BitString constructor #9

whus6207 opened this issue Oct 18, 2018 · 0 comments

Comments

@whus6207
Copy link

The current constructor of BitString is forced to use DEFAULT_BYTE_SIZE, which does not always match people's need. It'd be nice and simple to allow initialization with customized size:

/**
 * @param int $size
 */
public function __construct(int size=self::DEFAULT_BYTE_SIZE)
{
    $this->size = $size;
    $this->bytes = str_repeat(chr(0), $this->size);
}

Currently I'm forced to create an all-zeros string myself, and call createFromString, which is not very ideal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant