Skip to content

Commit

Permalink
libnixstore: drop unused convert_hash function
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Nov 2, 2024
1 parent b44f74a commit a988328
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
1 change: 0 additions & 1 deletion libnixstore/include/nix.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ bool is_valid_path(rust::Str path);
rust::String query_path_hash(rust::Str path);
InternalPathInfo query_path_info(rust::Str path, bool base32);
rust::String query_path_from_hash_part(rust::Str hash_part);
rust::String convert_hash(rust::Str algo, rust::Str s, bool to_base_32);
rust::String sign_string(rust::Str secret_key, rust::Str msg);
rust::Vec<unsigned char>
sign_detached(rust::Slice<const unsigned char> secret_key, rust::Str msg);
Expand Down
9 changes: 0 additions & 9 deletions libnixstore/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ mod ffi {
fn query_path_hash(path: &str) -> Result<String>;
fn query_path_info(path: &str, base32: bool) -> Result<InternalPathInfo>;
fn query_path_from_hash_part(hash_part: &str) -> Result<String>;
fn convert_hash(algo: &str, s: &str, to_base_32: bool) -> Result<String>;
fn sign_detached(secret_key: &[u8], msg: &str) -> Vec<u8>;
fn get_store_dir() -> String;
fn get_real_store_dir() -> String;
Expand Down Expand Up @@ -151,14 +150,6 @@ pub fn query_path_from_hash_part(hash_part: &str) -> Option<String> {
}
}

#[inline]
/// Parse the hash from a string representation in the format `[<type>:]<base16|base32|base64>` or
/// `<type>-<base64>` to a string representation of the hash, in `base-16`, `base-32`. The result
/// is not prefixed by the hash type.
pub fn convert_hash(algo: &str, s: &str, to_radix: Radix) -> Result<String, cxx::Exception> {
ffi::convert_hash(algo, s, matches!(to_radix, Radix::Base32))
}

#[inline]
/// Return a detached signature of the given string.
pub fn sign_detached(secret_key: &[u8], msg: &str) -> Vec<u8> {
Expand Down

0 comments on commit a988328

Please sign in to comment.