{"id":17108474,"url":"https://github.com/g-andrade/erlzord","last_synced_at":"2025-09-07T07:39:05.597Z","repository":{"id":57496840,"uuid":"89652131","full_name":"g-andrade/erlzord","owner":"g-andrade","description":"N-dimensional Z-order curves","archived":false,"fork":false,"pushed_at":"2025-09-02T13:36:16.000Z","size":4083,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-07T07:39:03.129Z","etag":null,"topics":["erlang","morton-code","morton-order","z-order"],"latest_commit_sha":null,"homepage":"","language":"Erlang","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/g-andrade.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"support/test_cases/.gitignore","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-04-28T00:38:31.000Z","updated_at":"2025-09-02T13:36:15.000Z","dependencies_parsed_at":"2025-04-13T02:48:31.501Z","dependency_job_id":"b0359e19-2048-40ac-a52c-85938675d8b3","html_url":"https://github.com/g-andrade/erlzord","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/g-andrade/erlzord","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-andrade%2Ferlzord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-andrade%2Ferlzord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-andrade%2Ferlzord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-andrade%2Ferlzord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/g-andrade","download_url":"https://codeload.github.com/g-andrade/erlzord/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-andrade%2Ferlzord/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274010097,"owners_count":25206763,"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-09-07T02:00:09.463Z","response_time":67,"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":["erlang","morton-code","morton-order","z-order"],"created_at":"2024-10-14T16:05:27.608Z","updated_at":"2025-09-07T07:39:05.553Z","avatar_url":"https://github.com/g-andrade.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Z-order curve / Morton code for Erlang\n\n[![Hex downloads](https://img.shields.io/hexpm/dt/erlzord.svg)](https://hex.pm/packages/erlzord)\n[![License](https://img.shields.io/hexpm/l/erlzord.svg)](https://github.com/g-andrade/erlzord/blob/master/LICENSE)\n[![Erlang Versions](https://img.shields.io/badge/Erlang%2FOTP-20.3%20to%2026-blue)](https://www.erlang.org)\n[![CI status](https://github.com/g-andrade/erlzord/actions/workflows/ci.yml/badge.svg)](https://github.com/g-andrade/erlzord/actions/workflows/ci.yml)\n[![Latest version](https://img.shields.io/hexpm/v/erlzord.svg?style=flat)](https://hex.pm/packages/erlzord)\n[![API reference](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/erlzord/)\n[![Last commit](https://img.shields.io/github/last-commit/g-andrade/erlzord.svg)](https://github.com/g-andrade/erlzord/commits/master)\n\n`erlzord` is an implementation of the [Z-order curve](https://en.wikipedia.org/wiki/Z-order_curve),\nor Morton code, for Erlang and Elixir.\n\nAny number of dimensions is supported and there is no limit on the bitsize of output values.\n\nThe test cases were generated based on an existing [Python implementation](https://github.com/LLNL/rubik/blob/master/rubik/zorder.py) from the [rubik](https://github.com/LLNL/rubik) project.\n\n### How to use\n\n#### Erlang\n\n##### 1\\. Import as a dependency\n\nrebar.config\n\n```erlang\n{deps, [\n    % [...]\n    {erlzord, \"~\u003e 2.0\"}\n]}.\n```\n\nyour\\_application.app.src\n\n```erlang\n{applications, [\n    kernel,\n    stdlib,\n    % [...]\n    erlzord\n]}\n```\n\n##### 2\\. Encode and decode your vectors\n\n2d points\n\n```erlang\nConfig = erlzord:config(#{\n    dimensions =\u003e 2,\n    min_component =\u003e -1000,\n    max_component =\u003e +1000\n}),\n\n1595729 = erlzord:encode({245, -456}, Config),\n{245,-456} = erlzord:decode(1595729, Config).\n```\n\n3d points\n\n```erlang\nConfig = erlzord:config(#{\n    dimensions =\u003e 3,\n    min_component =\u003e 0,\n    max_component =\u003e 100\n}),\n\n123788 = erlzord:encode({42, 52, 21}, Config),\n{42,52,21} = erlzord:decode_tuple(123788, Config).\n```\n\n10d points\n\n```erlang\nConfig = erlzord:config(#{\n    dimensions =\u003e 10,\n    min_component =\u003e 0,\n    max_component =\u003e 700\n}),\n\n740763791023146735114306653082 =\n    erlzord:encode([400,543,632,445,565,0,674,491,403,555], Config),\n\n[400,543,632,445,565,0,674,491,403,555] =\n    erlzord:decode_list(740763791023146735114306653082, Config).\n```\n\n#### Elixir\n\n##### 1\\. Import as a dependency\n\nmix.exs\n\n``` elixir\n  defp deps do\n    [\n      # [...]\n      {:erlzord, \"~\u003e 2.0\"}\n    ]\n  end\n```\n\n##### 2\\. Encode and decode your vectors\n\n2d points\n\n```elixir\nconfig = :erlzord.config(%{\n    dimensions: 2,\n    min_component: -1000,\n    max_component: +1000\n})\n\n1595729 = :erlzord.encode({245,-456}, config)\n{245,-456} = :erlzord.decode(1595729, Config)\n```\n\n3d points\n\n```elixir\nconfig = :erlzord.config(%{\n    dimensions: 3,\n    min_component: 0,\n    max_component: 100\n}),\n\n123788 = :erlzord.encode({42,52,21}, config)\n{42,52,21} = :erlzord.decode_tuple(123788, config)\n```\n\n10d points\n\n```elixir\nconfig = erlzord:config(%{\n    dimensions: 10,\n    min_component: 0,\n    max_component: 700\n}),\n\n740763791023146735114306653082 =\n    :erlzord.encode([400,543,632,445,565,0,674,491,403,555], config)\n\n[400,543,632,445,565,0,674,491,403,555] =\n    :erlzord.decode_list(740763791023146735114306653082, Config)\n```\n\n### API Reference\n\nThe API reference can be found on [HexDocs](https://hexdocs.pm/erlzord/).\n\n### License\n\nMIT License\n\nCopyright (c) 2017-2024 Guilherme Andrade\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy 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, EXPRESS\nOR 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg-andrade%2Ferlzord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fg-andrade%2Ferlzord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg-andrade%2Ferlzord/lists"}