-
-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bitfield): add toggleAt(), setRange(), update ctor
- update BitField ctor to accept bit string or bool array - add size check in resize(), bail if not different - add setRange() for BitField - add toggleAt() for BitField & BitMatrix - add bitField() and bitMatrix() factory fns - extract common toString()
- Loading branch information
1 parent
300fe2b
commit 6ed20c1
Showing
3 changed files
with
92 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { B32 } from "@thi.ng/strings"; | ||
|
||
/** | ||
* Converts 1D bitfield to binary string. | ||
* | ||
* @param data - | ||
* | ||
* @internal | ||
*/ | ||
export const toString = (data: Uint32Array) => [...data].map(B32).join(""); |