{"id":24558057,"url":"https://github.com/rse/peertime","last_synced_at":"2025-10-14T06:16:08.996Z","repository":{"id":66345628,"uuid":"151849151","full_name":"rse/peertime","owner":"rse","description":"Network Peer Time Synchronization","archived":false,"fork":false,"pushed_at":"2021-01-09T13:26:18.000Z","size":22,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T11:56:46.901Z","etag":null,"topics":["network","p2p","peer","synchronization","time"],"latest_commit_sha":null,"homepage":"http://npmjs.com/peertime","language":"JavaScript","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/rse.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-10-06T14:42:46.000Z","updated_at":"2024-04-23T15:54:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"872d4c3e-0035-4821-af47-680f2e49a286","html_url":"https://github.com/rse/peertime","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/rse/peertime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fpeertime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fpeertime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fpeertime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fpeertime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rse","download_url":"https://codeload.github.com/rse/peertime/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rse%2Fpeertime/sbom","scorecard":{"id":787183,"data":{"date":"2025-08-11","repo":{"name":"github.com/rse/peertime","commit":"a836fed5120c41431ea2f8893c00bc0f8cdc4e22"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/23 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":"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":"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":"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":"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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-23T06:23:18.151Z","repository_id":66345628,"created_at":"2025-08-23T06:23:18.151Z","updated_at":"2025-08-23T06:23:18.151Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018122,"owners_count":26086280,"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-14T02:00:06.444Z","response_time":60,"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":["network","p2p","peer","synchronization","time"],"created_at":"2025-01-23T05:47:16.206Z","updated_at":"2025-10-14T06:16:08.986Z","avatar_url":"https://github.com/rse.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nPeerTime\n========\n\nNetwork Peer Time Synchronization for Node.js and Browser.\n\n\u003cp/\u003e\n\u003cimg src=\"https://nodei.co/npm/peertime.png?downloads=true\u0026stars=true\" alt=\"\"/\u003e\n\n\u003cp/\u003e\n\u003cimg src=\"https://david-dm.org/rse/peertime.png\" alt=\"\"/\u003e\n\nAbout\n-----\n\nThis is a small JavaScript library for Node.js and the Browser to\nsynchronize the time between networking peers by determining a\nglobally-aligned local time. This is inevitable in a network of peers\nwhere exchanged data has to be locally timestamped with a globally\nagreed time.\n\nAlgorithm\n---------\n\nPeerTime uses the following time synchronization protocol between a local node and\na peer node:\n\n1. REQUEST: Local node stamps its current (potentially already globally aligned)\n   local time and sends it in a `TIME-REQ` (request) data frame to a peer node.\n\n2. RESPONSE: Upon receipt of the `TIME-REQ` frame, peer node stamps its\n   current (potentially already globally aligned) local time and sends it\n   in a `TIME-RES` (response) data frame to the local node.\n\n3. ADJUSTMENT: Upon receipt of the `TIME-RES` frame, local node\n   subtracts its current local time from the previously sent local time and\n   divides it by two to compute network latency. It subtracts current local\n   time from peer time to determine communication time delta and adds in\n   the half-latency to get the correct local time offset.\n\nThe first determined clock offset is immediately be used to adjust the local time\nsince it will get the local time into at least the right ballpark.\n\nThe local node then repeats the above steps 1 through 3 a few times,\npausing a few seconds each time. Other network communication is allowed\nin the interim, but should be minimized for best results.\n\nThe results of the determined local time offsets are accumulated and\nsorted in a lowest-latency to highest-latency order. The median latency\nis then determined by picking the mid-point sample from this ordered\nlist. All samples above approximately one standard-deviation from the\nmedian are discarded and the remaining samples are averaged using an\narithmetic mean. In case of multiple peers, the arithmetic average of\nthe local time offset against all peers are taken as the final local\ntime offset.\n\nInstallation\n------------\n\n```shell\n$ npm install peertime\n```\n\nUsage\n-----\n\nSee the [TypeScript API definition](./src/peertime.d.ts) for all details\non the Application Programming Interface (API) of PeerTime.\n\nCredits\n-------\n\nPeerTime was inspired by a similar library named\n[timesync](https://github.com/enmasseio/timesync) and\nPeerTime's underlying core synchronization algorithm was\nderived from this library, which in turn derived it from the\n[NTP](https://en.wikipedia.org/wiki/Network_Time_Protocol) and\n[SNTP](http://www.mine-control.com/zack/timesync/timesync.html) time\nsynchronization protocols. The major difference between PeerTime and\n[timesync](https://github.com/enmasseio/timesync) is that PeerTime\nis fully agnostic to the network layer, both from a JavaScript API\nperspective and NPM package dependency perspective and hence can be more\neasily embedded into other frameworks or larger libraries.\n\nLicense\n-------\n\nCopyright (c) 2018-2021 Dr. Ralf S. Engelschall (http://engelschall.com/)\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frse%2Fpeertime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frse%2Fpeertime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frse%2Fpeertime/lists"}