{"id":20139055,"url":"https://github.com/threeletters/simpleprotocols","last_synced_at":"2026-03-11T15:37:48.362Z","repository":{"id":57361378,"uuid":"80871085","full_name":"ThreeLetters/SimpleProtocols","owner":"ThreeLetters","description":"Serialize any data structure into binaries! Allows for small, efficient, and secure communications","archived":false,"fork":false,"pushed_at":"2018-12-09T05:17:44.000Z","size":184,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-12T05:50:34.961Z","etag":null,"topics":["binary-data","browser","code-generator","nodejs","protocol-generator"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThreeLetters.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}},"created_at":"2017-02-03T21:31:54.000Z","updated_at":"2025-04-09T05:33:58.000Z","dependencies_parsed_at":"2022-09-07T20:00:11.853Z","dependency_job_id":null,"html_url":"https://github.com/ThreeLetters/SimpleProtocols","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ThreeLetters/SimpleProtocols","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThreeLetters%2FSimpleProtocols","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThreeLetters%2FSimpleProtocols/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThreeLetters%2FSimpleProtocols/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThreeLetters%2FSimpleProtocols/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThreeLetters","download_url":"https://codeload.github.com/ThreeLetters/SimpleProtocols/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThreeLetters%2FSimpleProtocols/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266412318,"owners_count":23924486,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["binary-data","browser","code-generator","nodejs","protocol-generator"],"created_at":"2024-11-13T21:43:49.047Z","updated_at":"2026-03-11T15:37:48.310Z","avatar_url":"https://github.com/ThreeLetters.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleProtocols\nSerialize your data in binary! Generates unique protocols resistant to decoding\n\n## Purpose\nTakes a data structure in JavaScript and generates unique code to serialize and unserialize it. Has high amounts of security to prevent anyone from decoding the protocol. Each generation is unique, so if someone cracked your protocol, you can generate again using this tool. Very useful for security in web applications and IO games.\n\n## Usage\n\u003e node index.js\n\n1. Edit the data.json file to specify data types. (You can also edit options.json)\n2. Run `node cli.js`\n3. Generated code located at /out/\n\n\u003e require(\"simpleprotocols\")\n\n1. Do `npm install simpleprotocols`.\n2. Use it in your code!\n\n```js\nvar SimpleProtocols = require(\"simpleprotocols\");\nvar output = SimpleProtocols(dataStruct,options);\n```\n\n## Documentation\n\n### Data types\n1. `int [min] [max]` - Integer/number. Can be decimals. Greatest amount of decimals given is used.\n2. `int [type]` - Integer/number. Can be: `dynamic`, `int8`, `uint8`, `int16`, `uint16`, `int32`, `uint32`, `uint24`, `float32`\n3. `string [encoding]` - A string. Encodings include `8` (default), `16`, and `32`.\n\n### Arrays\n#### Fixed arrays\nYou can have a fixed array by doing:\n\n```\n[\n\"length [length]\",\n\"your stuff\"\n]\n```\n#### Dynamic arrays\nYou can have dynamic arrays by doing\n```\n[\n\"Your stuff\"\n]\n```\n\n### Objects\nYou can have objects by doing\n```\n{\nhello: \"int 0 255\",\nthis: \"string\",\nis: \"string 16\",\naobject: \"int 0 10000\"\n}\n```\n\n### Conditionals\nYou can also have conditional statements\n```\n{\nif: \"obj.type == 0\",\nthen: \"something\",\nelse: \"anotherthing\" \n}\n```\n\n### Security Features\nThere are some security features to protect the protocols from being read.\n\n1. shuffleObjects - Shuffle order in objects. Default: true\n2. scrambleConditionals - Scramble conditional statements. Default: true\n3. scrambleNumbers - Scramble numbers. Default: true\n4. encodeStrings - Encode strings using rc4 encryption. Default: false\n5. maskStrings - Masks strings so that they cannot be read easily. Default: true\n6. maskLength - Sets a mask length. Default: [4,6]\n7. pack - Pack output code using Dean Edward's packer (http://dean.edwards.name/packer/). Not a significant security feature. Default: false\n\n## Note:\nThe json files in this project are not actually json. This is to simplify its syntax. `eval()` is used to evaluate the files.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreeletters%2Fsimpleprotocols","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthreeletters%2Fsimpleprotocols","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreeletters%2Fsimpleprotocols/lists"}