{"id":15043648,"url":"https://github.com/ebay/lexicaldecimal","last_synced_at":"2025-10-04T05:31:34.622Z","repository":{"id":53238149,"uuid":"229331635","full_name":"eBay/lexicalDecimal","owner":"eBay","description":"A Lexicographical encoding of Java BigDecimals","archived":true,"fork":false,"pushed_at":"2021-04-01T02:32:39.000Z","size":43,"stargazers_count":9,"open_issues_count":0,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-07-27T03:37:33.028Z","etag":null,"topics":["bigdecimal-utils","java","lexicographical"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eBay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-20T20:28:12.000Z","updated_at":"2023-07-03T15:30:06.000Z","dependencies_parsed_at":"2022-08-19T20:20:23.241Z","dependency_job_id":null,"html_url":"https://github.com/eBay/lexicalDecimal","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/eBay/lexicalDecimal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBay%2FlexicalDecimal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBay%2FlexicalDecimal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBay%2FlexicalDecimal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBay%2FlexicalDecimal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eBay","download_url":"https://codeload.github.com/eBay/lexicalDecimal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBay%2FlexicalDecimal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278267482,"owners_count":25958873,"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-04T02:00:05.491Z","response_time":63,"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":["bigdecimal-utils","java","lexicographical"],"created_at":"2024-09-24T20:49:22.933Z","updated_at":"2025-10-04T05:31:34.332Z","avatar_url":"https://github.com/eBay.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lexical Decimal\n\n## Description\n\nThis library provides an implementation of a lexicographical encoding/decoding of BigDecimals. This allows you to store\nBigDecimal values as byte arrays in a key value store, or other similar storage engines. The ordering of the encoded\nvalue matches the ordering of the BigDecimal values.\n\nThis uses the encoding described in the Decimal Infinite paper.\n\nFourny, Ghislain. (2015). [decimalInfinite: All Decimals In Bits, No Loss, Same Order, Simple.](https://www.researchgate.net/publication/278734280_decimalInfinite_All_Decimals_In_Bits_No_Loss_Same_Order_Simple)\n  \n## Usage\n\n1. Add a maven dependency.\n\n```xml\n \u003cdependency\u003e\n   \u003cgroupId\u003ecom.ebay.data.encoding\u003c/groupId\u003e\n   \u003cartifactId\u003elexical-decimal\u003c/artifactId\u003e\n   \u003cversion\u003e1.0\u003c/version\u003e\n \u003c/dependency\u003e\n ```\n\n2. Encode a value\n\n```java\n    BigDecimal val = new BigDecimal(\"1234.5678\");\n    byte []encoded = BigDecimalEncoding.encode(val).toByteArray();\n```\n\n3. Decode a previously encoded value\n\n```java\n    byte []encoded ...\n    BigDecimal val = BigDecimalEncoding.decode(encoded);\n```\n\n4. Accessing the encoded value\n\nEncoding returns an instance of the Bits class that represents the encoded value. As above it can generate\na byte array. In addition it can also write the bits to an existing array or Stream.\n\n```java\n    OutputStream os = getOutputStream();\n    BigDecimal val = new BigDecimal(\"1234.5678\");\n    BigDecimalEncoding.encode(val).writeTo(os);\n```\n\n## See Also\n\n* [decimalgamma-cpp](https://github.com/ghislainfourny/decimalgamma-cpp) Is a c++ implementation from the paper's Author.\n* [decimalInfinite](https://github.com/ghislainfourny/decimalInfinite) a JSONiq implementation.\n\n## License\n\nCopyright 2019 eBay Inc.\nAuthor/Developer: Simon Fell\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\nhttps://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febay%2Flexicaldecimal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febay%2Flexicaldecimal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febay%2Flexicaldecimal/lists"}