{"id":24557806,"url":"https://github.com/timclicks/microservice-checksum","last_synced_at":"2025-04-19T03:12:45.737Z","repository":{"id":138084288,"uuid":"187340231","full_name":"timClicks/microservice-checksum","owner":"timClicks","description":"A HTTP microservice that provides a checksum to POSTed data","archived":false,"fork":false,"pushed_at":"2019-05-25T20:40:13.000Z","size":17,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T03:05:18.755Z","etag":null,"topics":["crc","crc-calculation","crc16","crc32","crc64","http","microservice","rocket-rs","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/timClicks.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}},"created_at":"2019-05-18T09:42:04.000Z","updated_at":"2019-10-21T19:39:44.000Z","dependencies_parsed_at":"2023-07-02T11:16:16.067Z","dependency_job_id":null,"html_url":"https://github.com/timClicks/microservice-checksum","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timClicks%2Fmicroservice-checksum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timClicks%2Fmicroservice-checksum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timClicks%2Fmicroservice-checksum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timClicks%2Fmicroservice-checksum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timClicks","download_url":"https://codeload.github.com/timClicks/microservice-checksum/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249598181,"owners_count":21297464,"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","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":["crc","crc-calculation","crc16","crc32","crc64","http","microservice","rocket-rs","rust"],"created_at":"2025-01-23T05:29:34.410Z","updated_at":"2025-04-19T03:12:45.732Z","avatar_url":"https://github.com/timClicks.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# microservice-checksum\n\nA HTTP microservice that provides a checksum to POSTed data. POST data to it, \nand it will send you back a checksum.\n\nIf you have wanted to experiment with building a microservice in Rust,\nthis might be useful as an example. \n\n# Usage\n\n## Server-side\n\nRun the executable:\n\n```\n$ ROCKET_ENV=prod microservice-checksum\n🔧 Configured for production.\n    =\u003e address: 0.0.0.0\n    =\u003e port: 8000\n    =\u003e log: critical\n    =\u003e workers: 24\n    =\u003e secret key: generated\n    =\u003e limits: forms = 32KiB\n    =\u003e keep-alive: 5s\n    =\u003e tls: disabled\nWarning: environment is 'production', but no `secret_key` is configured\n🚀 Rocket has launched from http://0.0.0.0:8000\n```\n\n## Client-side\n\n`microservice-checksum` supports 3 endpoints: `/crc16`, `/crc32`, `/crc64`.\nFrom a new console window, you can POST data with `curl` via the `-d` option.\n\n```\n$ curl localhost:8000/crc32 -d 'hello?'\n1619653635\n```\n\n```\n$ curl localhost:8000/crc64 -d 'yes!'\n6344572155291762688\n```\n\n```\n$ curl localhost:8000/crc16 -d 'that was easy'\n15643\n```\n\n(CRC16 comes last because it's the least likely to be used. Sorry CRC16.)\n\n## Custom polynomials\n\nEach endpoint supports using custom polynomials if you wish to be specific:\n\n**CRC16**\n\n`/crc16?polynomial=usb` (default)\n\n`/crc16?polynomial=x25`\n\n`/crc16?polynomial=n` where _n_ [0, 65,535] inclusive\n\n**CRC32**\n\n`/crc16?polynomial=ieee` (default)\n\n`/crc16?polynomial=castagnoli`\n\n`/crc16?polynomial=koopman`\n\n`/crc16?polynomial=n` where _n_ [0, 4,294,967,295] inclusive\n\n**CRC64**\n\n`/crc64?polynomial=ecma` (default)\n\n`/crc64?polynomial=iso`\n\n`/crc64?polynomial=n` where _n_ [0, 18,446,744,073,709,551,615] inclusive\n\n# Performance\n\nYour client should expect a response within 3ms. Usually it's closer to 1.\n\n# Build instructions\n\n## Pre-requisites \n\nInstall Rust, git (just in case) and GCC (Rust needs its linker)\n\n```\nsudo apt install build-essential git\ncurl -fsSL https://sh.rustup.rs | sh\n```\n\nInstall `microservice-checksum`:\n\n```\ncargo install --git https://github.com/timClicks/microservice-checksum\n```\n\n## (Optional) Generate a static binary\n\nInstall the pre-requisites \n\n```\nsudo apt install musl-tools \nrustup target add x86_64-unknown-linux-musl\n```\n\nBuild the binary:\n\n```\ngit clone https://github.com/timClicks/microservice-checksum\ncd microservice-checksum\ncargo build --release --target x86_64-unknown-linux-musl\n```\n\nVerify:\n\n```\ntarget/x86_64-unknown-linux-musl/release/microservice-checksum\n```\n\n\n# Acknowledgements\n\nI did none of the hard work for this. Please thank the maintainers\nof the `rocket` and `crc` crates.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimclicks%2Fmicroservice-checksum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimclicks%2Fmicroservice-checksum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimclicks%2Fmicroservice-checksum/lists"}