{"id":16687960,"url":"https://github.com/danielpclark/base_custom","last_synced_at":"2025-08-14T05:10:49.467Z","repository":{"id":57503023,"uuid":"95045050","full_name":"danielpclark/base_custom","owner":"danielpclark","description":"Rust implementation of custom numeric base conversion.","archived":false,"fork":false,"pushed_at":"2018-12-07T01:17:49.000Z","size":31,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-07T15:18:14.533Z","etag":null,"topics":["base-conversion","number-converter","numeric","numerical-calculations"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/danielpclark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-21T20:50:46.000Z","updated_at":"2021-12-28T22:05:20.000Z","dependencies_parsed_at":"2022-09-13T08:30:34.153Z","dependency_job_id":null,"html_url":"https://github.com/danielpclark/base_custom","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielpclark%2Fbase_custom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielpclark%2Fbase_custom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielpclark%2Fbase_custom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielpclark%2Fbase_custom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielpclark","download_url":"https://codeload.github.com/danielpclark/base_custom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219855406,"owners_count":16556095,"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":["base-conversion","number-converter","numeric","numerical-calculations"],"created_at":"2024-10-12T15:26:08.202Z","updated_at":"2024-10-12T15:26:08.845Z","avatar_url":"https://github.com/danielpclark.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# base_custom\n[![Build Status](https://travis-ci.org/danielpclark/base_custom.svg?branch=master)](https://travis-ci.org/danielpclark/base_custom)\n[![crates.io version](https://img.shields.io/crates/v/base_custom.svg)](https://crates.io/crates/base_custom)\n[![License](https://img.shields.io/crates/l/base_custom.svg)]()\n\nUse any characters as your own numeric base and convert to and from decimal.  This can be taken advantage of in various ways:\n\n* Mathematics: number conversion\n* Brute force sequencing\n* Rolling ciphers\n* Moderate information concealment\n* Other potential uses such as deriving music or art from numbers\n\n_There is also a Ruby and Crystal implementation of this which this was based off of._\n\n### Installation\n\nAdd the following to your Cargo.toml file\n```toml\n[dependencies]\nbase_custom = \"^0.2\"\n```\n\nTo include it for usage add\n\n```rust\nextern crate base_custom;\nuse base_custom::BaseCustom;\n```\n\nto your file.\n\n### Usage\n\n```rust\n// Binary with no delimiter\nlet base2 = BaseCustom::\u003cchar\u003e::new(\"01\".chars().collect());\nassert_eq!(base2.decimal(\"00001\"), 1_u64);\nassert_eq!(base2.decimal(\"100110101\"), 309_u64);\nassert_eq!(base2.gen(340), \"101010100\");\nassert_eq!(base2.gen(0xF45), \"111101000101\");\nassert_eq!(base2.gen(0b111), \"111\");\n\n// Trinary with no delimiter\nlet base3 = BaseCustom::\u003cchar\u003e::new(\"ABC\".chars().collect());\nassert_eq!(base3.decimal(\"ABC\"), 5);\nassert_eq!(base3.gen(123), \"BBBCA\");\n\n// Custom base like Musical Chords and a space delimiter\nlet base_music = BaseCustom::\u003cString\u003e::new(\"A A# B C C# D D# E F F# G G#\", Some(' '));\nassert_eq!(base_music.decimal(\"F F# B D# D A# D# F# \"), 314159265);\nassert_eq!(base_music.gen(314159265), \"F F# B D# D A# D# F# \");\n```\n\nWhen using `BaseCustom::\u003cString\u003e::new` the second parameter must be of `Option\u003cchar\u003e` to\nchoose your optional delimiter.\n\n### Benchmarks\n\nBenchmarks are provided for the various usages and implementations. `BaseCustom\u003cchar\u003e` is\nby far the most efficient implementation.\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielpclark%2Fbase_custom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielpclark%2Fbase_custom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielpclark%2Fbase_custom/lists"}