{"id":21966882,"url":"https://github.com/cdefgah/bencoder4j","last_synced_at":"2025-10-10T12:30:50.361Z","repository":{"id":136824527,"uuid":"116607225","full_name":"cdefgah/bencoder4j","owner":"cdefgah","description":"Bit-torrent encoding and decoding implementation for Java programming language.","archived":false,"fork":false,"pushed_at":"2024-12-16T17:30:35.000Z","size":382,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T21:23:20.142Z","etag":null,"topics":["bencode","bencoder","bencoding","bit-torrent","deserialization","java","javalibrary","library","serialization","torrent"],"latest_commit_sha":null,"homepage":"","language":"Java","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/cdefgah.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2018-01-07T23:28:35.000Z","updated_at":"2024-12-16T17:30:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"8d4052db-2ec5-4736-92dc-72f74037571c","html_url":"https://github.com/cdefgah/bencoder4j","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cdefgah/bencoder4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdefgah%2Fbencoder4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdefgah%2Fbencoder4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdefgah%2Fbencoder4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdefgah%2Fbencoder4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdefgah","download_url":"https://codeload.github.com/cdefgah/bencoder4j/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdefgah%2Fbencoder4j/sbom","scorecard":{"id":269665,"data":{"date":"2025-08-11","repo":{"name":"github.com/cdefgah/bencoder4j","commit":"7a588ab7156d3f8a226161e1d9a109a0f9f113a4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"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":"Code-Review","score":0,"reason":"Found 0/19 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":"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":10,"reason":"no dangerous workflow patterns detected","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":"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/cdefgah/bencoder4j/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/cdefgah/bencoder4j/build.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: no jobLevel write permissions found"],"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":"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":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":"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":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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-17T13:00:45.024Z","repository_id":136824527,"created_at":"2025-08-17T13:00:45.024Z","updated_at":"2025-08-17T13:00:45.024Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003901,"owners_count":26083641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bencode","bencoder","bencoding","bit-torrent","deserialization","java","javalibrary","library","serialization","torrent"],"created_at":"2024-11-29T13:18:56.865Z","updated_at":"2025-10-10T12:30:50.019Z","avatar_url":"https://github.com/cdefgah.png","language":"Java","readme":"## Bencode Serializer and Deserializer\n\n[![Build Status](https://github.com/cdefgah/bencoder4j/workflows/build/badge.svg)](https://github.com/cdefgah/bencoder4j/actions) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.cdefgah/bencoder4j/badge.svg)](http://search.maven.org/#artifactdetails%7Ccom.github.cdefgah%7Cbencoder4j%7C1.1.0%7Cjar)\n\n[Bit-torrent](https://en.wikipedia.org/wiki/Bencode) encoding and decoding implementation for the Java programming language.\n\n### Simple use case\n\nThis project is available as a [Maven](https://maven.apache.org/) [dependency](http://search.maven.org/#artifactdetails%7Ccom.github.cdefgah%7Cbencoder4j%7C1.1.0%7Cjar):\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.cdefgah\u003c/groupId\u003e\n    \u003cartifactId\u003ebencoder4j\u003c/artifactId\u003e\n    \u003cversion\u003e1.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nBelow, you can see a piece of code that writes a set of arbitrary objects to the `file.ben`, located in my home `Downloads` folder. \n\nBear in mind that provided examples fit my OS (Ubuntu Linux) and environment (path with my user name). Chances are that these parameters slightly differ in your case, so be sure to modify the `filePath` variable accordingly. \n\n```java\npackage example;\n\nimport com.github.cdefgah.bencoder4j.CircularReferenceException;\nimport com.github.cdefgah.bencoder4j.model.BencodedByteSequence;\nimport com.github.cdefgah.bencoder4j.model.BencodedDictionary;\nimport com.github.cdefgah.bencoder4j.model.BencodedInteger;\nimport com.github.cdefgah.bencoder4j.model.BencodedList;\n\nimport java.io.FileOutputStream;\nimport java.io.IOException;\n\npublic class WriterApp {\n\n    public static void main(String[] args) throws IOException, CircularReferenceException {\n\n        BencodedInteger bencodedInteger = new BencodedInteger(1234567890);\n        BencodedByteSequence bencodedByteSequence = new BencodedByteSequence(\"Hi :)\");\n\n        BencodedList bencodedList = new BencodedList();\n        BencodedInteger intListElement = new BencodedInteger(1);\n        BencodedByteSequence bbsListElement = new BencodedByteSequence(\"abc\");\n\n        bencodedList.add(intListElement);\n        bencodedList.add(bbsListElement);\n\n        BencodedDictionary bencodedDictionary = new BencodedDictionary();\n\n        BencodedByteSequence dictKey1 = new BencodedByteSequence(\"111\");\n        BencodedByteSequence dictKey2 = new BencodedByteSequence(\"222\");\n\n        BencodedInteger intDictElement = new BencodedInteger(2);\n        BencodedByteSequence bbsDictElement = new BencodedByteSequence(\"xyz\");\n\n        bencodedDictionary.put(dictKey1, intDictElement);\n        bencodedDictionary.put(dictKey2, bbsDictElement);\n\n\n        String filePath = \"/home/rafael/Downloads/file.ben\";\n        try (FileOutputStream fos = new FileOutputStream(filePath)) {\n\n            bencodedInteger.writeObject(fos);\n            bencodedByteSequence.writeObject(fos);\n            bencodedList.writeObject(fos);\n            bencodedDictionary.writeObject(fos);\n\n        }\n    }\n}\n```\n\nNow, as we have the composed `file.ben`in the `Downloads` folder, we can use the following code to read its contents.\n\n```java\npackage example;\n\nimport com.github.cdefgah.bencoder4j.BencodeFormatException;\nimport com.github.cdefgah.bencoder4j.io.BencodeStreamIterator;\nimport com.github.cdefgah.bencoder4j.model.BencodedObject;\n\nimport java.io.FileInputStream;\nimport java.io.IOException;\n\npublic class ReaderApp {\n    public static void main(String[] args) throws IOException, BencodeFormatException {\n\n        String filePath = \"/home/rafael/Downloads/file.ben\";\n        try(FileInputStream fis = new FileInputStream(filePath)) {\n            BencodeStreamIterator bis = new BencodeStreamIterator(fis);\n\n            while (bis.hasNext()) {\n                BencodedObject bencodedObject = bis.next();\n                System.out.println(bencodedObject);\n            }\n        }\n    }\n}\n```\n\nUse cases given above are the most basic, simple examples. For more please refer to [the tests](https://github.com/cdefgah/bencoder4j/tree/master/src/test) for the project.\n\n### Documentation\n\n[API Documentation](https://cdefgah.github.io/bencoder4j/apidocs/allclasses-index.html)\n\n[Changelog](https://github.com/cdefgah/bencoder4j/blob/master/CHANGELOG.md)\n\n### Licensing\n\n[MIT License](https://github.com/cdefgah/bencoder4j/blob/master/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdefgah%2Fbencoder4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdefgah%2Fbencoder4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdefgah%2Fbencoder4j/lists"}