{"id":39120995,"url":"https://github.com/alanmacleod/bit-meddler","last_synced_at":"2026-01-17T20:34:59.599Z","repository":{"id":143858180,"uuid":"104183704","full_name":"alanmacleod/bit-meddler","owner":"alanmacleod","description":"Very quickly scramble (shuffle?) a range of integers via a linear feedback shift register implementation. Thrilling 😐","archived":false,"fork":false,"pushed_at":"2017-09-27T04:24:25.000Z","size":500,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T02:32:17.466Z","etag":null,"topics":["binary","bit-manipulation","bit-mask","numerical-analysis","pseudo-random","random","scrambler","shift-register","shuffle","xor"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/bit-meddler","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alanmacleod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-09-20T07:49:46.000Z","updated_at":"2024-03-07T09:14:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"9a5be6f1-e7c1-4ed4-82e7-b7253b6fddf3","html_url":"https://github.com/alanmacleod/bit-meddler","commit_stats":{"total_commits":53,"total_committers":2,"mean_commits":26.5,"dds":"0.018867924528301883","last_synced_commit":"91b971dc5dc60827d2ac41309b0c89b13bd8d709"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alanmacleod/bit-meddler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanmacleod%2Fbit-meddler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanmacleod%2Fbit-meddler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanmacleod%2Fbit-meddler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanmacleod%2Fbit-meddler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alanmacleod","download_url":"https://codeload.github.com/alanmacleod/bit-meddler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanmacleod%2Fbit-meddler/sbom","scorecard":{"id":177526,"data":{"date":"2025-08-11","repo":{"name":"github.com/alanmacleod/bit-meddler","commit":"91b971dc5dc60827d2ac41309b0c89b13bd8d709"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 1/29 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":"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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T18:03:51.395Z","repository_id":143858180,"created_at":"2025-08-16T18:03:51.395Z","updated_at":"2025-08-16T18:03:51.395Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28517729,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T18:55:29.170Z","status":"ssl_error","status_checked_at":"2026-01-17T18:55:03.375Z","response_time":85,"last_error":"SSL_read: 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":["binary","bit-manipulation","bit-mask","numerical-analysis","pseudo-random","random","scrambler","shift-register","shuffle","xor"],"created_at":"2026-01-17T20:34:58.932Z","updated_at":"2026-01-17T20:34:59.592Z","avatar_url":"https://github.com/alanmacleod.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/alanmacleod/bit-meddler.svg?branch=master)](https://travis-ci.org/alanmacleod/bit-meddler)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n# bit-meddler\n\nReturns randomish integers in a given range.\n\nThe practical use of this package doesn't reveal itself until you go for stupid big-ass numbers. Like `100,000` which would take a relatively long time and waste a ton of memory to iterate through and return each integer only once using Math.random() and a flags array.\n\n[Watch a live demo here](https://demos.alanmacleod.eu/bit-meddler/pub/)\n\n![demo](https://raw.githubusercontent.com/alanmacleod/bit-meddler/master/demo/img/demo.png)\n\nIf Bette Midler ever needed a lightweight method to scramble a range of numbers without resorting to a random number generator or an array, oh boy, she would surely:\n\n```\nnpm install --save bit-meddler\n```\n\n...and to scramble those numbers between, say, `1` and `1000`:\n\n```js\nlet bitmeddler = require('bit-meddler');\n\nlet meddle = new bitmeddler(1000)\n\nmeddle.next(); // give me a number\n```\n\nCalling `.next()` will return every number between `1` and `1000` in a scrambled, pseudorandom order. The method will return a `null` once every number has been returned. You can then call `.reset()` to start again if you wish.\n\nAn optional second parameter is a seed number to vary the order:\n\n```js\nlet seed = 42;\nlet meddle = new bitmeddler(1000, seed);\n```\n\nIf you just want access to the full list of numbers, there's a convenient `all` method for that:\n\n```js\nlet meddle = new bitmeddler(1000);\n\nlet scrambled = meddle.all(); // return array of 1000 scrambled integers\n```\n\nSo it's not \"very random\" but produces a passable simulation if speed and low memory usage are amongst your requirements. It uses a linear feedback shift register design adapted for software. I remember writing games as a kid on bait hardware bending my brain trying to think of a way to do this without an array. So thanks to this book [Game Engine Black Book: Wolfenstein 3D](http://fabiensanglard.net/Game_Engine_Black_Book_Release_Date/index.php) for finally revealing the method to me years later. And also [this website was handy](https://www.maximintegrated.com/en/app-notes/index.mvp/id/4400).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falanmacleod%2Fbit-meddler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falanmacleod%2Fbit-meddler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falanmacleod%2Fbit-meddler/lists"}