{"id":19961184,"url":"https://github.com/fisothemes/twincat-hashing-algorithms","last_synced_at":"2026-02-17T09:39:38.755Z","repository":{"id":156946005,"uuid":"585404795","full_name":"fisothemes/TwinCAT-Hashing-Algorithms","owner":"fisothemes","description":"A library containing the most commonly used non-cryptographic hashing functions such as MurmurHash3, CRC32 and FNV1a. All functions Hash data of type ANY.","archived":false,"fork":false,"pushed_at":"2023-03-04T11:21:05.000Z","size":919,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T00:29:48.099Z","etag":null,"topics":["beckhoff","crc32","fnv-1a","hash","hashing","iec61131-3","industrial-automation","murmurhash3","plc","twincat","twincat3"],"latest_commit_sha":null,"homepage":"","language":null,"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/fisothemes.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":"2023-01-05T04:43:46.000Z","updated_at":"2024-04-12T09:22:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"a6c78f18-1333-415d-810e-888434a61254","html_url":"https://github.com/fisothemes/TwinCAT-Hashing-Algorithms","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fisothemes/TwinCAT-Hashing-Algorithms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fisothemes%2FTwinCAT-Hashing-Algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fisothemes%2FTwinCAT-Hashing-Algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fisothemes%2FTwinCAT-Hashing-Algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fisothemes%2FTwinCAT-Hashing-Algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fisothemes","download_url":"https://codeload.github.com/fisothemes/TwinCAT-Hashing-Algorithms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fisothemes%2FTwinCAT-Hashing-Algorithms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29539232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T08:11:05.436Z","status":"ssl_error","status_checked_at":"2026-02-17T08:09:38.860Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["beckhoff","crc32","fnv-1a","hash","hashing","iec61131-3","industrial-automation","murmurhash3","plc","twincat","twincat3"],"created_at":"2024-11-13T02:06:37.220Z","updated_at":"2026-02-17T09:39:38.747Z","avatar_url":"https://github.com/fisothemes.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# TwinCAT Hashing Algorithms\n\nA library containing the most commonly used non-cryptographic hashing functions such as [MurmurHash3](https://en.wikipedia.org/wiki/MurmurHash), [CRC32](https://lxp32.github.io/docs/a-simple-example-crc32-calculation/) and [FNV1a](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function). All functions Hash data of type [ANY](https://infosys.beckhoff.com/content/1033/tc3_plc_intro/2529426571.html).\n\n# Table of Contents\n* Functions\n    * [F_CRC32](#f_crc32)\n    * [F_DJB2](#f_djb2)\n    * [F_FNV1a](#f_fnv1a)\n    * [F_Lose_Lose](#f_lose_lose)\n    * [F_MurMurHash3](#f_murmurhash3)\n    * [F_SDBM](#f_sdbm)\n    * [F_Hash_Code](#f_hash_code)\n* [Developer Notes](#developer-notes)\n\n# F_CRC32\n**Signature:**\n```Pascal\nFUNCTION F_CRC32 : DWORD\nVAR_INPUT\n\tData : ANY;\nEND_VAR\n```\n## Example\n**Declarations:** \n```Pascal\nsData        : STRING  := '123456789';\nnData        : DINT    := 123456789;\nnSTRING_Hash,\nnDINT_Hash   : DWORD;\n```\n**Implementation:**\n```Pascal\nnSTRING_Hash    := F_CRC32(sData); // Output: 3421780262\nnDINT_Hash      := F_CRC32(nData); // Output: 417295518\n```\n**Source:** https://lxp32.github.io/docs/a-simple-example-crc32-calculation/\n\n\n# F_DJB2\n**Signature:**\n```Pascal\nFUNCTION F_DJB2 : DWORD\nVAR_INPUT\n\tData : ANY;\nEND_VAR\n```\n## Example\n**Declarations:** \n```Pascal\nsData        : STRING  := '123456789';\nnData        : DINT    := 123456789;\nnSTRING_Hash,\nnDINT_Hash   : DWORD;\n```\n**Implementation:**\n```Pascal\nnSTRING_Hash    := F_DJB2(sData); // Output: 902675330\nnDINT_Hash      := F_DJB2(nData); // Output: 2087454537\n```\n**Source:** http://www.cse.yorku.ca/~oz/hash.html\n\n\n# F_FNV1a\n**Signature:**\n```Pascal\nFUNCTION F_FNV1a : DWORD\nVAR_INPUT\n\tData : ANY;\nEND_VAR\n```\n## Example\n**Declarations:** \n```Pascal\nsData        : STRING  := '123456789';\nnData        : DINT    := 123456789;\nnSTRING_Hash,\nnDINT_Hash   : DWORD;\n```\n**Implementation:**\n```Pascal\nnSTRING_Hash    := F_FNV1a(sData); // Output: 3146166556\nnDINT_Hash      := F_FNV1a(nData); // Output: 1186151337\n```\n**Source:** http://www.isthe.com/chongo/tech/comp/fnv/\n\n\n# F_Lose_Lose\n**Signature:**\n```Pascal\nFUNCTION F_Lose_Lose : DWORD\nVAR_INPUT\n\tData : ANY;\nEND_VAR\n```\n## Example\n**Declarations:** \n```Pascal\nsData        : STRING  := '123456789';\nnData        : DINT    := 123456789;\nnSTRING_Hash,\nnDINT_Hash   : DWORD;\n```\n**Implementation:**\n```Pascal\nnSTRING_Hash    := F_Lose_Lose(sData); // Output: 477\nnDINT_Hash      := F_Lose_Lose(nData); // Output: 324\n```\n**Source:** http://www.cse.yorku.ca/~oz/hash.html\n\n\n# F_MurMurHash3\n**Signature:**\n```Pascal\nFUNCTION F_MurMurHash3 : DWORD\nVAR_INPUT\n\tData : ANY;\nEND_VAR\n```\n## Example\n**Declarations:** \n```Pascal\nsData        : STRING  := '123456789';\nnData        : DINT    := 123456789;\nnSTRING_Hash,\nnDINT_Hash   : DWORD;\n```\n**Implementation:**\n```Pascal\nnSTRING_Hash    := F_MurMurHash3(sData); // Output: 3036607362\nnDINT_Hash      := F_MurMurHash3(nData); // Output: 3206620847\n```\n**Source:** https://en.wikipedia.org/wiki/MurmurHash\n\n# F_SDBM\n**Signature:**\n```Pascal\nFUNCTION F_SDBM : DWORD\nVAR_INPUT\n\tData : ANY;\nEND_VAR\n```\n## Example\n**Declarations:** \n```Pascal\nsData        : STRING  := '123456789';\nnData        : DINT    := 123456789;\nnSTRING_Hash,\nnDINT_Hash   : DWORD;\n```\n**Implementation:**\n```Pascal\nnSTRING_Hash    := F_SDBM(sData); // Output: 1755344949\nnDINT_Hash      := F_SDBM(nData); // Output: 912040036\n```\n**Source:** http://www.cse.yorku.ca/~oz/hash.html\n\n# F_Hash_Code\n**Description:**\n\n64-bit hash code generated using MurmurHash3 and FNV1a hashing algorithms. Hash code is different for each runtime to mitigate [hash flooding](https://en.wikipedia.org/wiki/Collision_attack#:~:text=certificates.%5B14%5D-,Hash%20flooding,-%5Bedit%5D).\n\n**Signature:**\n```Pascal\nFUNCTION F_Hash_Code : LWORD\nVAR_INPUT\n\tData : ANY;\nEND_VAR\n```\n## Example\n**Declarations:** \n```Pascal\nsData        : STRING  := '123456789';\nnData        : DINT    := 123456789;\nnSTRING_Hash,\nnDINT_Hash   : LWORD;\n```\n**Implementation:**\n```Pascal\nnSTRING_Hash    := F_Hash_Code(sData); // Output: See description\nnDINT_Hash      := F_Hash_Code(nData); // Output: See description\n```\n\n# Developer Notes\nTBD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffisothemes%2Ftwincat-hashing-algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffisothemes%2Ftwincat-hashing-algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffisothemes%2Ftwincat-hashing-algorithms/lists"}