#nixos #base32 #nix #hash #character-set

nix-base32

Provides a nix (as in NixOS) compatible base32 encoding

4 releases

0.2.0 Aug 23, 2024
0.1.2-alpha.0 Apr 18, 2020
0.1.1 Nov 29, 2019
0.1.0 Nov 29, 2019

#3 in #nixos

Download history 848/week @ 2024-11-21 903/week @ 2024-11-28 1320/week @ 2024-12-05 977/week @ 2024-12-12 514/week @ 2024-12-19 410/week @ 2024-12-26 595/week @ 2025-01-02 765/week @ 2025-01-09 1081/week @ 2025-01-16 1175/week @ 2025-01-23 1721/week @ 2025-01-30 1544/week @ 2025-02-06 707/week @ 2025-02-13 852/week @ 2025-02-20 1126/week @ 2025-02-27 1159/week @ 2025-03-06

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

Apache-2.0

7KB
60 lines

nix-base32

Crate

This crate implements conversion between a [u8] slice and its Nix-specific base32 representation. 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:

Nix-specific base32 encoder/decoder

This crate implements conversion between a [u8] slice and its Nix-specific base32 representation. SHA256 hash codes in nix are usually encoded in base32 with an unusual set of characters (without E O U T).

No runtime deps