{"id":39834151,"url":"https://github.com/monicanagent/sdb","last_synced_at":"2026-01-20T16:52:02.921Z","repository":{"id":86692059,"uuid":"177513950","full_name":"monicanagent/sdb","owner":"monicanagent","description":"Services Descriptor Bundle encoding and decoding library","archived":false,"fork":false,"pushed_at":"2025-12-01T02:28:06.000Z","size":88,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-03T12:51:51.330Z","etag":null,"topics":["bundle","client","connectivity","descriptor","javascript","p2p","sdb","server","services"],"latest_commit_sha":null,"homepage":null,"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/monicanagent.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-03-25T04:25:52.000Z","updated_at":"2025-12-01T02:28:10.000Z","dependencies_parsed_at":"2023-06-10T20:45:12.947Z","dependency_job_id":null,"html_url":"https://github.com/monicanagent/sdb","commit_stats":{"total_commits":47,"total_committers":1,"mean_commits":47.0,"dds":0.0,"last_synced_commit":"ec43e7b9045718e52cd3150a9d2a0eb0d518633d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/monicanagent/sdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monicanagent%2Fsdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monicanagent%2Fsdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monicanagent%2Fsdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monicanagent%2Fsdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monicanagent","download_url":"https://codeload.github.com/monicanagent/sdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monicanagent%2Fsdb/sbom","scorecard":{"id":658518,"data":{"date":"2025-08-11","repo":{"name":"github.com/monicanagent/sdb","commit":"10135665f07c2939d93d88e53ed2cb27c77d22dc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"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":"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":"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":"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":"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":"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":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"}}]},"last_synced_at":"2025-08-21T15:23:04.797Z","repository_id":86692059,"created_at":"2025-08-21T15:23:04.797Z","updated_at":"2025-08-21T15:23:04.797Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28536751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T13:04:05.990Z","status":"ssl_error","status_checked_at":"2026-01-18T13:01:44.092Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["bundle","client","connectivity","descriptor","javascript","p2p","sdb","server","services"],"created_at":"2026-01-18T13:19:00.318Z","updated_at":"2026-01-18T13:19:00.970Z","avatar_url":"https://github.com/monicanagent.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Services Descriptor Bundle\n\n\nSDB is an efficient and compact binary format used for connectivity establishment between peers, clients, and servers, designed for CypherPoker.JS\n\nDetailed background and technical information can be found in [TECHNICAL.md](./TECHNICAL.md)\n\n## Usage\n\n### Node.js \n\n[![npm (tag)](https://img.shields.io/npm/v/sdb-node/latest.svg)](https://www.npmjs.com/package/sdb-node)\n\n1. Install the module from npm:\n\n`npm i sdb-node`\n\n2. Include in your code:\n\n```\nconst SDB = require(\"sdb-node\");\nvar sdb = new SDB();\n```\n\n### Browser\n\n1. Include the SDB library bundle in your page `\u003chead\u003e`:\n\n`\u003cscript src=\"https://monicanagent.github.io/sdb/bundle.min.js\" type=\"text/javascript\" language=\"javascript\"\u003e\u003c/script\u003e`\n\n2. Include in your code:\n\n```\nvar sdb = new SDB();\n```\n\n#### Now you can:\n\n#### Decode Base85-encoded SDB data:\n\n```\n   let sdbBase85 = '\u003c~z!\\'^G`(INIeBOu3\\\\Deip)/kT%b;e9umBk(^q!\u003c\u003cj#:e;dNATDs.@qB^(ASu$tDeX*2!W`B)\"9?69!!*6FRK3Bg!%J3R!\u003cE0::bkiiEb0-!AU8N\u003cF`S[:DId^)Bl8\"o!\u003cWB+!5PN5!sKd9~\u003e';   \n   sdb.decode(sdbBase85).then(result =\u003e {\n      if (result) {\n         console.dir(sdb.data);\n      }\n   });\n\n   /*\n   Console output:\n\n   [ { entity: 'api',\n    name: 'CypherPoker.JS Services',\n    description: 'API services endpoint',\n    transport: 'wss',\n    protocol: 'ws',\n    host: '192.168.0.0',\n    port: 8090 },\n  { entity: 'p2p',\n    name: 'CypherPoker.JS Services',\n    description: 'P2P rendezvous endpoint',\n    transport: 'wss',\n    protocol: 'ws',\n    host: '192.168.0.0',\n    port: 8091 } ]\n   */\n```\n#### Decode Base64-encoded SDB data:\n```\n   let sdbBase64 = \"AAAAAAA/AAAXQ3lwaGVyUG9rZXIuSlMgU2VydmljZXMBABVBUEkgc2VydmljZXMgZW5kcG9pbnQCAQMCBADAqAABBR+aAQAAACoHAAEBABdQMlAgcmVuZGV6dm91cyBlbmRwb2ludAIBAwIEAMCoAAMFH5s=\";   \n   sdb.decode(sdbBase64).then(result =\u003e {\n      if (result) {\n         console.dir(sdb.data);\n      }\n   });\n\n   /*\n   Console output:\n\n   [ { entity: 'api',\n    name: 'CypherPoker.JS Services',\n    description: 'API services endpoint',\n    transport: 'wss',\n    protocol: 'ws',\n    host: '192.168.0.0',\n    port: 8090 },\n  { entity: 'p2p',\n    name: 'CypherPoker.JS Services',\n    description: 'P2P rendezvous endpoint',\n    transport: 'wss',\n    protocol: 'ws',\n    host: '192.168.0.0',\n    port: 8091 } ]\n   */\n```\n#### Encode SDB data to Base85:\n```\n   /* compact form combines 'protocol', 'host', and 'port' into single 'url' property */\n   var sdbJS = [\n      {\n         entity: \"api\",\n         url: \"ws://127.0.0.1:8090\"\n      }\n   ]\n   sdb.decode (sdbJS); //already a native array object so this simply assigns the data\n   sdb.encode(\"base85\").then (result =\u003e {\n      console.log (\"Base85 SDB: \"+result);\n      console.log (\"Base85 size: \"+result.length);\n      console.log (\"Compact JSON: \"+JSON.stringify(sdbJS, 0));\n      console.log (\"Compact JSON size: \"+JSON.stringify(sdbJS, 0).length); //strips out whitespace\n   });\n\n   /*\n   Console output:\n\n   Base85 SDB: \u003c~z!\"/l1\"9\u003coO!!*6FRK*\u003cf~\u003e\n   Base85 size: 25\n   Compact JSON: [{\"entity\":\"api\",\"url\":\"ws://127.0.0.1:8090\"}]\n   Compact JSON size: 46\n   */\n```\n\u003csmall\u003eNote that the Base85 data book-ends `\u003c~` and `~\u003e` may be omitted to reduce the data size by an additional 4 bytes.\u003c/small\u003e\n#### Encode SDB data to Base64:\n```   \n   var sdbJS = [\n      {\n         entity: \"api\",\n         url: \"ws://127.0.0.1:8090\"\n      }\n   ]\n   sdb.decode (sdbJS);\n   sdb.encode(\"base64\").then(result =\u003e {\n      console.log (\"Base64 SDB: \"+result);\n      console.log (\"Base64 size: \"+result.length);\n      console.log (\"Compact JSON: \"+JSON.stringify(sdbJS, 0));\n      console.log (\"Compact JSON size: \"+JSON.stringify(sdbJS, 0).length);\n   });\n\n   /*\n   Console output:\n\n   sdbBase64 SDB: AAAAAAALAwIEAH8AAAEFH5o=\n   sdbBase64 size: 24\n   Compact JSON: [{\"entity\":\"api\",\"url\":\"ws://127.0.0.1:8090\"}]\n   Compact JSON size: 46\n   */\n```\n#### Encode SDB data to Hexadecimal:\n\u003csmall\u003eHexadecimal encoding is not included in the `encode` function due to the (usually) large output size but here's how to do it anyway.\u003c/small\u003e\n```   \n   var sdbJS = [\n      {\n         entity: \"api\",\n         url: \"ws://127.0.0.1:8090\"\n      }\n   ]\n   sdb.decode (sdbJS);\n   sdb.encode(\"none\").then (result =\u003e {\n      console.log (\"Hex SDB: \"+sdb.bin.toString(\"hex\"));\n      console.log (\"Hex size: \"+sdb.bin.toString(\"hex\").length);\n      console.log (\"Compact JSON: \"+JSON.stringify(sdbJS, 0));\n      console.log (\"Compact JSON size: \"+JSON.stringify(sdbJS, 0).length);\n   });\n\n   /*\n   Console output:\n\n   Hex SDB: 00000000000b030204007f000001051f9a\n   Hex size: 34\n   Compact JSON: [{\"entity\":\"api\",\"url\":\"ws://127.0.0.1:8090\"}]\n   Compact JSON size: 46\n   */\n```\n#### Decode SDB data from Hexadecimal:\n\u003csmall\u003eHexadecimal encoding is not included in the `decode` function due to the (usually) large input string size but here's how to do it anyway.\u003c/small\u003e\n```   \n   let sdbHex = \"00000000000b030204007f000001051f9a\";\n   let sdbBuffer = Buffer.from(sdbHex, \"hex\");\n   sdb.decode(sdbBuffer).then(result =\u003e {\n      if (result) {\n         console.dir(sdb.data);\n      }\n   });   \n\n   /*\n   Console output:\n\n   [ { entity: 'api', protocol: 'ws', host: '127.0.0.0', port: 8090 } ]\n   */\n```\n#### And More\n\nOther examples of SDB encoding and decoding using a mixture of asynchronous and synchronous functions as well as processing pipes can be found in the examples directory: [https://github.com/monicanagent/sdb/blob/master/example/](https://github.com/monicanagent/sdb/blob/master/example/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonicanagent%2Fsdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonicanagent%2Fsdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonicanagent%2Fsdb/lists"}