Skip to content

Commit

Permalink
Rename get_publisher_id to get_publisher_hash
Browse files Browse the repository at this point in the history
  • Loading branch information
russellbanks committed Jul 29, 2024
1 parent 7bff7ba commit 5eaad75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "package-family-name"
version = "1.2.0"
version = "1.2.1"
edition = "2021"
license = "MIT OR Apache-2.0"
categories = ["no-std"]
Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ use fast32::base32::CROCKFORD_LOWER;
use sha2::{Digest, Sha256};

pub fn get_package_family_name(identity_name: &str, identity_publisher: &str) -> String {
format!("{identity_name}_{}", get_publisher_id(identity_publisher))
format!("{identity_name}_{}", get_publisher_hash(identity_publisher))
}

pub fn get_publisher_id(identity_publisher: &str) -> String {
pub fn get_publisher_hash(identity_publisher: &str) -> String {
let publisher_sha_256 = identity_publisher
.encode_utf16()
.flat_map(u16::to_le_bytes)
Expand All @@ -23,7 +23,7 @@ pub fn get_publisher_id(identity_publisher: &str) -> String {

#[cfg(test)]
mod tests {
use crate::{get_package_family_name, get_publisher_id};
use crate::{get_package_family_name, get_publisher_hash};

#[test]
fn test_package_family_name() {
Expand All @@ -34,7 +34,7 @@ mod tests {
}

#[test]
fn test_package_family_hash() {
assert_eq!(get_publisher_id("Publisher Software"), "zj75k085cmj1a");
fn test_publisher_hash() {
assert_eq!(get_publisher_hash("Publisher Software"), "zj75k085cmj1a");
}
}

0 comments on commit 5eaad75

Please sign in to comment.