{"id":18774093,"url":"https://github.com/ephellon/siphun","last_synced_at":"2025-07-29T09:36:14.656Z","repository":{"id":84333832,"uuid":"141032747","full_name":"Ephellon/Siphun","owner":"Ephellon","description":"A hashing algorithm","archived":false,"fork":false,"pushed_at":"2018-10-12T02:25:11.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-29T08:42:16.919Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ephellon.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}},"created_at":"2018-07-15T14:11:49.000Z","updated_at":"2018-10-12T02:25:12.000Z","dependencies_parsed_at":"2023-03-12T22:24:07.786Z","dependency_job_id":null,"html_url":"https://github.com/Ephellon/Siphun","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/Ephellon%2FSiphun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ephellon%2FSiphun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ephellon%2FSiphun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ephellon%2FSiphun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ephellon","download_url":"https://codeload.github.com/Ephellon/Siphun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239680987,"owners_count":19679509,"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":[],"created_at":"2024-11-07T19:37:19.704Z","updated_at":"2025-02-19T15:18:07.306Z","avatar_url":"https://github.com/Ephellon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Siphun (Signature Function)\nDesigned to be a near-perfect hashing algorithm.\n\n## Why?\nThe belief behind creating Siphun was that hashing tables shouldn't be a fixed length, but should instead have a variable length with a set maximum size. E.g. [MD5](https://www.ietf.org/rfc/rfc1321.txt) has a fixed length of sixteen 8-bit characters (32 hexadecimal characters), a maximum hash table size of 16\u003csup\u003e32\u003c/sup\u003e (340 undecillion\u003csup\u003e1A\u003c/sup\u003e) entries; while Siphun on the other hand, can have a length between 0 characters (empty string = **200**), and 256 alphanumeric characters (lowercase), providing a staggering [266 vigin-trillion](https://latex.codecogs.com/png.latex?%5Cdpi%7B150%7D%20%5Cbg_white%20%5Clarge%201%20\u0026plus;%20%5Csum_%7Ba%3D1%7D%5E%7B256%7D%20%5Csum_%7Bb%3D16%7D%5E%7B36%7D%20b%5Ea)\u003csup\u003e1B\u003c/sup\u003e possible table entries.\n\n----\n\n## Testing\nYou can use the following code to test Siphun's fidelity output. Be sure to compile/append [siphun.js](siphun.js) first.\n\n```javascript\n// Siphun - unit testing\nfunction test(string, ...fidels) {\n  var s = string, f = fidels,\n      q = '\\u00b7', Q = '=',\n      S = [], T = [], X = Siphun;\n\n  var c = n =\u003e (n + 10).toString(36).toUpperCase().split('').reverse().join(''),\n      a = n =\u003e (() =\u003e {});\n\n  for(var i = 0, j, l = f.length; i \u003c l;)\n    S.push(X(s, f[i++]));\n\n  for(i = 0; i \u003c l; i++)\n    for(j = i + 1; j \u003c l; j++)\n      T.push((function(A, B, C) {\n        for(var x = 0, t = '', n = 0, k = A.length, m = B.length, l, u; x \u003c k || x \u003c m; x++)\n          A = (q.repeat(m) + A).slice(-(k \u003e m? k: m)),\n          B = (q.repeat(m) + B).slice(-(k \u003e m? k: m)),\n          t += ( (u = A[x] == B[x])? A[x]: q ),\n          n += +u;\n        return `\\n${C[0] = c(C[0])} vs ${C[1] = c(C[1])}: Likeness ${(100*(l=n/m))|0}% / char-count ${k}:${m} / Strength ${100-(l*(k+m))|0}%\\n${C[0]} \u003e ${A}\\n${C[1]} \u003e ${B}\\n    ${Q.repeat(x)}\\n    ${t}`;\n      })(S[i], S[j], [i, j]));\n\n  for(i = 0; i \u003c T.length; i++)\n    console.log(T[i]);\n}\n```\n\n----\n\n## Notes\n\n+ 1A) MD5: **340,282,366,920,938,463,463,374,607,431,768,211,456**\n+ 1B) Siphun: **266,683,066,789,469,258,497,647,949,142,213,022,551,159,626,626,691,307,750,616,461,182,161,817,566,910,286,233,732,911,130,911,935,051,069,280,070,768,383,514,583,647,127,112,413,713,937,441,846,050,018,161,125,771,682,172,963,628,853,185,807,181,758,974,761,779,134,604,051,543,641,094,610,614,391,668,250,496,244,833,601,914,991,506,599,946,821,115,352,140,916,055,224,972,376,724,360,450,048,348,560,347,827,991,696,473,462,897,149,632,286,215,282,118,562,704,911,206,947,971,052,426,288,340,500,057,576,373,977,473,707,655,771**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fephellon%2Fsiphun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fephellon%2Fsiphun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fephellon%2Fsiphun/lists"}