https://github.com/danielpclark/base_custom_cr
Define any numeric base conversion with any identifier for each value.
https://github.com/danielpclark/base_custom_cr
base crystal numeric shard
Last synced: 25 days ago
JSON representation
Define any numeric base conversion with any identifier for each value.
- Host: GitHub
- URL: https://github.com/danielpclark/base_custom_cr
- Owner: danielpclark
- License: mit
- Created: 2017-04-11T11:48:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-11T12:17:29.000Z (over 8 years ago)
- Last Synced: 2025-07-15T12:39:42.151Z (3 months ago)
- Topics: base, crystal, numeric, shard
- Language: Crystal
- Size: 31.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BaseCustom
[](https://travis-ci.org/danielpclark/base_custom_cr)
by Daniel P. Clark
Ported from Ruby gem [basecustom](https://github.com/danielpclark/basecustom).
Inspired by:
* base62 by "JT Zemp" and contributors "Saadiq Rodgers-King", "Derrick Camerino"**Description**
* Define any numeric base conversion with any identifier for each value.require "basecustom"base2 = BaseCustom.new("01")
base2.base("00001")
=> 1
base2.base("100110101")
=> 309
base2.base(340)
=> "101010100"
base2.base(0xF45)
=> "111101000101"baseABC = BaseCustom.new("ABC")
baseABC.base("ABC")
=> 5
baseABC.base(123)
=> "BBBCA"# Usage Video
[](http://www.youtube.com/embed/b7TdvicxIrs)
# Version History
Version 1.0.2
* Cleaned up gemspec.Version 1.0.1
* Enabled use of special characters like newline (\n) or tab (\t) to be counted
as acceptable numeric characters. These characters can now also be printed with
expected behavior.Version 1.0.0
* Bump version number. Gem has proven ready as a version 1 release.Version 0.1.8
* Changed .all() to join by delimiterVersion 0.1.7
* Added features .length() and .all()Version 0.1.6
* Fixed 0 as 0 bug.Version 0.1.5
* Added jmchambers' debug from jtzemp/base62 to avoid infinite loop in Rails 3.0.7Version 0.1.4
* My father suggested delimiter splitting on String initialization made more sense.
* Test-Unit assertions fixed/updated.Version 0.1.3
* Fixed multicharacter numbering units
* Added delimiter for multicharacter numbering units
* Safe base type creation. Each situation checked for and proper error messages.Version 0.1.2
* Added unique to string init declaration
* Added unique to array as well as checking that all array elements are stringsVersion 0.1.1
* Flatten array's on input initializationVersion 0.1.0
* Complete Release