Initial commit

This commit is contained in:
Greg Shuflin 2024-04-06 22:44:20 -07:00
commit 554e063278
6 changed files with 41 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
target/

7
Cargo.lock generated Normal file
View File

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "programming-bitcoin"
version = "0.1.0"

12
Cargo.toml Normal file
View File

@ -0,0 +1,12 @@
[package]
name = "programming-bitcoin"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

1
README Normal file
View File

@ -0,0 +1 @@
Going through _Programming Bitcoin_ the book, but in rust

7
src/bin/main.rs Normal file
View File

@ -0,0 +1,7 @@
use programming_bitcoin::FieldElement;
fn main() {
println!("Hello, world!");
let a = FieldElement::new(1, 7);
println!("Field element: {:?}", a);
}

13
src/lib.rs Normal file
View File

@ -0,0 +1,13 @@
#[derive(Debug)]
pub struct FieldElement {
num: u64,
prime: u64,
}
impl FieldElement {
pub fn new(num: u64, prime: u64) -> Self {
Self {
num, prime
}
}
}