Initial commit
This commit is contained in:
commit
554e063278
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
target/
|
7
Cargo.lock
generated
Normal file
7
Cargo.lock
generated
Normal 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
12
Cargo.toml
Normal 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
1
README
Normal file
@ -0,0 +1 @@
|
||||
Going through _Programming Bitcoin_ the book, but in rust
|
7
src/bin/main.rs
Normal file
7
src/bin/main.rs
Normal 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
13
src/lib.rs
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user