0.01
No commit activity in last 3 years
No release in over 3 years
Handy Conversion Sexagesimal (base 60) for Short URLs Cuts out ambiguous characters like: * l : lowercase l (looks like a 1 : one) * I : capital I (looks like a 1 : one) * O : capital O (looks like a 0 : zero) Based on work done by Tantek Çelik : [http://tantek.pbworks.com/New_base_60](http://tantek.pbworks.com/New_base_60 "tantek / New_base_60")
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.6
~> 4.0
 Project Readme

New Base 60

https://github.com/veganstraightedge/new_base_60

Description

Handy Conversion Sexagesimal (base 60) for Short URLs Cuts out ambiguous characters like:

  • l : lowercase L (looks like a 1 : one)
  • I : capital i (looks like a 1 : one)
  • O : capital o (looks like a 0 : zero)

Based on work done by Tantek Çelik : http://ttk.me/w/NewBase60

Features/Problems

  • Converts Base10 (like 147124) to Base60 (like fs4)
  • Converts Base60 (like fs4) to Base10 (like 147124)
  • Converts Base60 (like fs4) to a Time object (Mon Oct 23 23:00:00 -0800 2372)

Synopsis

How to use:

require "new_base_60"
n = NewBase60.new("464")# => #<NewBase60:0x1011ea468 @base_60="464">
puts n.to_i             # => 14764
puts n.to_i.to_sxg      # => "464"
puts n.to_date          # => #<Date: 4910703/2,0,2299161>
puts n.to_date.to_s     # => "2010-06-04"
puts n.to_date.to_sxg   # => "464"

Or, on the command line:

$ dec_to_sxg 115727
Y8n
$ sxg_to_dec Y8n
115727

If you want a shortcut, add this to your .bash_profile:

alias sd="sxg_to_dec"
alias ds="dec_to_sxg"

Install

sudo gem install new_base_60

Credits

Contributors

License

PUBLIC DOMAIN

Your heart is as free as the air you breathe.
The ground you stand on is liberated territory.

In legal text, new_base_60 is dedicated to the public domain using Creative Commons -- CC0 1.0 Universal.

http://creativecommons.org/publicdomain/zero/1.0