crockford-0.2: An implementation of Douglas Crockford's base32 encoding.

Codec.Crockford

Description

This module implements Douglas Crockford's base32 encoding scheme to store integers as text. See http://www.crockford.com/wrmg/base32.html for more details on how this scheme works.

Synopsis

Documentation

encode :: Integral i => i -> StringSource

Encodes an integer into a String, using Douglas Crockford's base32 encoding.

decode :: Integral i => String -> Maybe iSource

Decodes a Crockford-encoded String into an integer, if possible. Returns Nothing if the string is not a valid Crockford-encoded value.

prop_crockfordRoundTripSource

Arguments

:: Integer

The integer to test.

-> Property 

A QuickCheck property that asserts a positive integer encoded and then decoded using this module remains the same number.