docs.rs failed to build base32-fs-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
base32-fs-0.1.3
base32-fs
This crate implements a variant of BASE32 encoding for hashes that are used as file names: no two encoded hashes can be decoded to the same original hash unless there is a hash collision.
To achieve that the crate
- uses the same characters when encoding and decoding the data
as opposed to the original Crockford's alphabet that permits e.g. both "a" and "A" to be decoded to
10; - doesn't zero-extend invalid input lengths when decoding.
Besides that the crate
- uses only lowercase letters instead of uppercase as the most common representation of hashes;
- doesn't use padding characters;
- doesn't change the sorting order of the encoded data.
Usage
Encode into PathBuf
use PathBuf;
use ;
let input = *b"hello";
let mut output = with_capacity;
encode;
assert_eq!;
Decode from PathBuf
use Path;
use ;
let input = new;
let mut output: = Vecnew;
decode;
assert_eq!;
Encode into Vec<u8>
use ;
let input = *b"hello";
let mut output: = Vecwith_capacity;
encode;
let string = from_utf8.expect;
assert_eq!;
Decode from &[u8]
use Path;
use ;
let input = b"d1jprv3f";
let mut output: = Vecwith_capacity;
decode;
assert_eq!;