Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 44 lines (28 sloc) 1.202 kb
b5011cf @epubify Initial commit to base32_pure.
epubify authored
1 = base32_pure
2
c84ab1e @epubify Inital commit
epubify authored
3 Encodes and decodes binary tokens to and from base32.
4
5 == Description
6
7 It uses the Crockford alphabet defined defined at http://www.crockford.com/wrmg/base32.html
8 - which is probably not the most efficient.
9
10 It is quite tolerant to user mistakes.
11
12 * It's case insensitive
13 * I,l and 1 maps to the same value
14 * 0 and O maps to the same value
15 * U is excluded to reduce the likelyhood of accidental obscenity
16
17 == Usage
18
19 require 'base32_pure'
20
21 encoded = Base32::Crockford.encode("Some token")
22 Base32::Crockford.decode(encoded)
23
24 hypenated = Base32::Crockford.hypenate(encoded)
25 Base32::Crockford.decode(hypenated)
26
27 == Features/problems
28
29 The optional check value is not implemented.
b5011cf @epubify Initial commit to base32_pure.
epubify authored
30
31 == Note on Patches/Pull Requests
32
33 * Fork the project.
34 * Make your feature addition or bug fix.
35 * Add tests for it. This is important so I don't break it in a
36 future version unintentionally.
37 * Commit, do not mess with rakefile, version, or history.
38 (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
39 * Send me a pull request. Bonus points for topic branches.
40
41 == Copyright
42
43 Copyright (c) 2010 Rune Myrland. See LICENSE for details.
Something went wrong with that request. Please try again.