{"id":34774735,"url":"https://github.com/luk3skyw4lker/bit-macros","last_synced_at":"2026-04-22T01:32:30.057Z","repository":{"id":119546866,"uuid":"288005328","full_name":"luk3skyw4lker/bit-macros","owner":"luk3skyw4lker","description":"A set of C macros to work with bit level operations.","archived":false,"fork":false,"pushed_at":"2020-12-28T19:31:11.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T19:46:49.941Z","etag":null,"topics":["cpp-macros","javascript","macros","npm-package"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/bit-macros","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luk3skyw4lker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-16T18:51:53.000Z","updated_at":"2021-07-06T18:50:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"eb93b00d-a608-4cab-97f6-2ced8b27ae45","html_url":"https://github.com/luk3skyw4lker/bit-macros","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"16adfc308be4418685d3f3baaf660d756d0ff63e"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/luk3skyw4lker/bit-macros","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luk3skyw4lker%2Fbit-macros","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luk3skyw4lker%2Fbit-macros/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luk3skyw4lker%2Fbit-macros/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luk3skyw4lker%2Fbit-macros/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luk3skyw4lker","download_url":"https://codeload.github.com/luk3skyw4lker/bit-macros/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luk3skyw4lker%2Fbit-macros/sbom","scorecard":{"id":603867,"data":{"date":"2025-08-11","repo":{"name":"github.com/luk3skyw4lker/bit-macros","commit":"16adfc308be4418685d3f3baaf660d756d0ff63e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/11 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"28 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T01:08:43.283Z","repository_id":119546866,"created_at":"2025-08-21T01:08:43.283Z","updated_at":"2025-08-21T01:08:43.283Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32117346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T00:31:26.853Z","status":"ssl_error","status_checked_at":"2026-04-22T00:30:22.894Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp-macros","javascript","macros","npm-package"],"created_at":"2025-12-25T08:13:31.648Z","updated_at":"2026-04-22T01:32:30.038Z","avatar_url":"https://github.com/luk3skyw4lker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bit-macros\n\nThis is a set of C macros used in embedded systems development for bit level operations. You can use them to directly manipulate the bit values on a integer variable.\n\nIt contains 4 fundamental macros:\n\n- set_bit: used to set the value of a bit from 0 to 1;\n- tst_bit: used to check if a bit inside a set of bits is equal to 1;\n- clr_bit: used to set the value of a bit from 1 to 0;\n- cpl_bit: used to toggle the bit value (from 0 to 1 or from 1 to 0);\n\n## set_bit\n\n```javascript\nconst { set_bit } = require(\"bit-macros\");\n\nconst integer_monday = set_bit(0, 1);\nconst integer_tuesday = set_bit(0, 2);\n\nconsole.log(integer_monday); // 2\nconsole.log(integer_tuesday): // 4\n\nconst monday_and_tuesday = integer_monday + integer_tuesday;\n\nconsole.log(monday_and_tuesday); // 6\n```\n\n## tst_bit\n\nThis macro works with **falsy** values. It returns an integer different of zero if the bit is actually activated on the value passed as argument.\n\n```javascript\nconst { tst_bit } = require(\"bit-macros\");\n\nconst value = 2;\n\n// The bit count starts from 0, so 1 means the second bit in the sequence\nif (tst_bit(value, 1)) {\n\t// Should be truthy since 2 in bit sequence is 00000010\n\tconsole.log(\"The variable has the second bit enabled\");\n} else {\n\tconsole.log(\"The variable doesn't have the second bit enabled\");\n}\n```\n\n## clr_bit\n\n```javascript\nconst { clr_bit } = require(\"bit-macros\");\n\nconst value = 255;\n\nconst cleared_value = clr_bit(value, 0);\n\nconsole.log(cleared_value); // 254;\n```\n\n## cpl_bit\n\n```javascript\nconst { cpl_bit } = require(\"bit-macros\");\n\nconst value = 255;\n\nconst coupled_value = cpl_bit(value, 7);\n\nconsole.log(coupled_value); // 127\n\nconst coupled_value2 = cpl_bit(coupled_value, 7);\n\nconsole.log(coupled_value2); // 255\n```\n\n# TODO\n\n- [ ] Add set/tst/clr/cpl many bits\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluk3skyw4lker%2Fbit-macros","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluk3skyw4lker%2Fbit-macros","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluk3skyw4lker%2Fbit-macros/lists"}