Initial commit
This commit is contained in:
commit
554e063278
|
@ -0,0 +1 @@
|
|||
target/
|
|
@ -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"
|
|
@ -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]
|
|
@ -0,0 +1 @@
|
|||
Going through _Programming Bitcoin_ the book, but in rust
|
|
@ -0,0 +1,7 @@
|
|||
use programming_bitcoin::FieldElement;
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
let a = FieldElement::new(1, 7);
|
||||
println!("Field element: {:?}", a);
|
||||
}
|
|
@ -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