{"id":22892449,"url":"https://github.com/ctronp/prime_worker","last_synced_at":"2025-03-31T22:10:39.733Z","repository":{"id":37794524,"uuid":"443182302","full_name":"ctronp/prime_worker","owner":"ctronp","description":"web api to Verify Prime numbers with 64 iterations of miller rabin test.","archived":false,"fork":false,"pushed_at":"2022-09-11T04:15:23.000Z","size":3198,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T01:17:29.443Z","etag":null,"topics":["primality-test","prime-numbers","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ctronp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-30T20:51:40.000Z","updated_at":"2022-08-12T23:17:11.000Z","dependencies_parsed_at":"2023-01-17T17:01:28.576Z","dependency_job_id":null,"html_url":"https://github.com/ctronp/prime_worker","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/ctronp%2Fprime_worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctronp%2Fprime_worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctronp%2Fprime_worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctronp%2Fprime_worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctronp","download_url":"https://codeload.github.com/ctronp/prime_worker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246547366,"owners_count":20794970,"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":["primality-test","prime-numbers","rust"],"created_at":"2024-12-13T23:00:03.135Z","updated_at":"2025-03-31T22:10:39.715Z","avatar_url":"https://github.com/ctronp.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prime Worker\n\nREST API that validates if values are strings.\n\n## Usage\n\n### endpoint: ```/primes```\n\npayload:\n\n```json\n{\n  \"values\": [\n    \"1\",\n    \"2\",\n    \"3\",\n    \"1000001\"\n  ]\n}\n```\n\n### endpoint: ```/```\n\nworks as health path. doesn't require validation\n\n## Environment variables\n\n- PORT: port where the app will run, default:```8080```\n- MAX_LEN: maximum quantity of digits of the numbers to test, default:```200```\n- SECRET_HEADER: header to validate the requests, default:```Secret```\n- SECRET: secret_header value to validate the request, default:```SecretStringExample1111000011110000```\n\n## Return\n\nreturn the numbers as keys and the result as value:\n\n(1)key: (2)value\n\n1. an input value\n2. if it's prime (\"Yes\", \"No\", \"Probably\")\n\n### Example:\n\n#### input:\n\nThe Json can have at most 20 values.\n\n```json\n{\n  \"values\": [\n    \"1\",\n    \"2\",\n    \"3\"\n  ]\n}\n```\n\n#### output:\n\n```json\n{\n  \"1\": \"No\",\n  \"2\": \"Yes\",\n  \"3\": \"Yes\"\n}\n```\n\n### Probably result\n\nif the result is ```Probably``` it means that it passed 64 iterations\nof Miller Rabin primality test.\n\nThe probability of the number not being a prime is $\\ \\frac{3}{4}^{64} = 10^{-8} $","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctronp%2Fprime_worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctronp%2Fprime_worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctronp%2Fprime_worker/lists"}