#base32 #nix #nixos #hash #byte-slice

nix-base32

Provides a nix (as in NixOS) compatible base32 encoding

3 releases

0.1.2-alpha.0 Apr 18, 2020
0.1.1 Nov 29, 2019
0.1.0 Nov 29, 2019

#740 in Cryptography

Download history 514/week @ 2024-03-13 763/week @ 2024-03-20 420/week @ 2024-03-27 539/week @ 2024-04-03 812/week @ 2024-04-10 835/week @ 2024-04-17 1103/week @ 2024-04-24 1279/week @ 2024-05-01 1449/week @ 2024-05-08 636/week @ 2024-05-15 1078/week @ 2024-05-22 548/week @ 2024-05-29 784/week @ 2024-06-05 726/week @ 2024-06-12 704/week @ 2024-06-19 765/week @ 2024-06-26

3,083 downloads per month
Used in 5 crates (4 directly)

Apache-2.0

6KB

nix-base32

Crate

This crate encodes a [u8] byte slice in a nix-compatible way. SHA256 hash codes in nix are usually encoded in base32 with an unusual set of characters (without E O U T).

    assert_eq!(
        to_nix_base32(
            &hex::decode("ab335240fd942ab8191c5e628cd4ff3903c577bda961fb75df08e0303a00527b")
                .unwrap()
        ),
        "0ysj00x31q08vxsznqd9pmvwa0rrzza8qqjy3hcvhallzm054cxb"
    );

lib.rs:

Encodes [u8] as base32 like nix

This crate encodes a [u8] byte slice in a nix-compatible way. SHA256 hash codes in nix are usually encoded in base32 with an unusual set of characters (without E O U T).

No runtime deps