Repository: crwood/deterministic-keygen (language: python)

Issue:
Project name conflicts with existing packages on PyPI and Crates.io
Packages named "degen" have already been uploaded to [PyPI](https://pypi.org/project/degen/) and [Crates.io](https://crates.io/crates/degen).

This project should be renamed to something else that is actually available on both indexes.

Blocks #3 #4


Discussion / hints:

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index e6c036e..4dd1978 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -129,17 +129,6 @@ dependencies = [
  "rand_core",
 ]
 
-[[package]]
-name = "degen"
-version = "0.1.0"
-dependencies = [
- "blake3",
- "pyo3",
- "rand_chacha",
- "rsa",
- "tiny-bip39",
-]
-
 [[package]]
 name = "der"
 version = "0.8.0-pre.0"
@@ -151,6 +140,17 @@ dependencies = [
  "zeroize",
 ]
 
+[[package]]
+name = "deterministic-keygen"
+version = "0.1.0"
+dependencies = [
+ "blake3",
+ "pyo3",
+ "rand_chacha",
+ "rsa",
+ "tiny-bip39",
+]
+
 [[package]]
 name = "digest"
 version = "0.10.7"
diff --git a/Cargo.toml b/Cargo.toml
index a8312d9..4ed372a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,11 +1,11 @@
 [package]
-name = "degen"
+name = "deterministic-keygen"
 version = "0.1.0"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 [lib]
-name = "degen"
+name = "deterministic_keygen"
 crate-type = ["cdylib"]
 
 [dependencies]
diff --git a/README.md b/README.md
index 88a1350..c2f420c 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
-Degen - a deterministic key-generator
-=====================================
+Deterministic-keygen
+====================
 
-_Degen_ is an experimental Rust and Python library for generating cryptographic keys deterministically, i.e., repeatably deriving the same key-material (output) given the same initial bytes of entropy (input). This can be used by applications to regenerate or restore a given key from some user-supplied input (for example, a BIP-39 mnemonic phrase), potentially enabling more "human-friendly" forms of key backup and recovery.
+_Deterministic-keygen_ is an experimental Rust and Python library for generating cryptographic keys deterministically, i.e., repeatably deriving the same key-material (output) given the same initial bytes of entropy (input). This can be used by applications to regenerate or restore a given key from some user-supplied input (for example, a BIP-39 mnemonic phrase), potentially enabling more "human-friendly" forms of key backup and recovery.
 
 Currently, only RSA keys are supported.
 
diff --git a/degen.pyi b/deterministic_keygen.pyi
similarity index 100%
rename from degen.pyi
rename to deterministic_keygen.pyi
diff --git a/pyproject.toml b/pyproject.toml
index 22eab0e..9bbbb53 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -3,7 +3,7 @@ requires = ["maturin>=1.3,<2.0"]
 build-backend = "maturin"
 
 [project]
-name = "degen"
+name = "deterministic-keygen"
 requires-python = ">=3.8"
 classifiers = [
     "Programming Language :: Rust",
diff --git a/src/lib.rs b/src/lib.rs
index 388fce2..726b3ad 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -11,7 +11,7 @@ use std::str;
 // "The context string should be hardcoded, globally unique, and application-specific.
 // A good default format for the context string is '[application] [commit timestamp]
 // [purpose]':"
-const RSA_CONTEXT: &str = "degen Wed 07 Feb 2024 11:50:00 AM EST RSA v1";
+const RSA_CONTEXT: &str = "deterministic-keygen Wed 07 Feb 2024 11:50:00 AM EST RSA v1";
 
 /// Generate a new BIP-39 mnemonic phrase.
 #[pyfunction]
@@ -74,7 +74,7 @@ pub fn derive_rsa_key_from_phrase(phrase: &str, bit_size: usize) -> PyResult<Str
 
 /// Deterministic key-generator.
 #[pymodule]
-fn degen(_py: Python, m: &PyModule) -> PyResult<()> {
+fn deterministic_keygen(_py: Python, m: &PyModule) -> PyResult<()> {
     m.add_function(wrap_pyfunction!(generate_phrase, m)?)?;
     m.add_function(wrap_pyfunction!(derive_rsa_key_from_phrase, m)?)?;
     Ok(())


Test patch:
diff --git a/tests/test_degen.py b/tests/test_degen.py
index 6e07cf2..9bc3200 100644
--- a/tests/test_degen.py
+++ b/tests/test_degen.py
@@ -1,4 +1,4 @@
-from degen import generate_phrase, derive_rsa_key_from_phrase
+from deterministic_keygen import generate_phrase, derive_rsa_key_from_phrase
 
 
 def test_generate_phrase_returns_12_words() -> None: