Sha256: 77415012d0c7b51772a2f50f1d9ccecd492cca48bb7496001c8d211a89ae8e1b

Contents?: true

Size: 466 Bytes

Versions: 3

Compression:

Stored size: 466 Bytes

Contents

=Anybase

==Arbitrary number bases

So often, I need to create random number bases, with random digits, to satisfy some crazy requirement.

Here is an example of how you'd do hex in Anybase.

  base = Anybase.new('0123456789abcdef')
  base.to_i('f0a')
  => 3850
  base.to_native(123450)
  => "1e23a"

Anybase gives you a few built-in:
Anybase::Hex, Anybase::Base64, Anybase::Base64ForURL and Anybase::Base62
(should all be pretty self-explanatory)

w00t, and cheers!

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
anybase-0.0.3 README.rdoc
anybase-0.0.2 README.rdoc
anybase-0.0.1 README.rdoc