Skip to content

Instantly share code, notes, and snippets.

View RandyMcMillan's full-sized avatar
🛰️
Those who know - do not speak of it.

@RandyMcMillan RandyMcMillan

🛰️
Those who know - do not speak of it.
View GitHub Profile
@RandyMcMillan
RandyMcMillan / usize.rs
Last active January 11, 2025 14:55 — forked from rust-play/playground.rs
usize.rs
use std::alloc::{alloc, dealloc, Layout};
//use std::fmt::Pointer;
fn main() {
// Number of elements to allocate
const NUM_ELEMENTS: usize = 100;
// Size of each element in bytes
const ELEMENT_SIZE: usize = 4; // Assuming 4 bytes per element (e.g., 32-bit integer)
// Calculate total size in bytes
@RandyMcMillan
RandyMcMillan / usize_alloc.rs
Last active January 11, 2025 14:39 — forked from rust-play/playground.rs
usize_alloc.rs
use std::alloc::{alloc, dealloc, Layout};
//use std::fmt::Pointer;
fn main() -> () {
// Number of elements to allocate
const NUM_ELEMENTS: usize = 100;
// Size of each element in bytes
const ELEMENT_SIZE: usize = 8; // Assuming 4 bytes per element (e.g., 32-bit integer)
// Calculate total size in bytes
@RandyMcMillan
RandyMcMillan / usize_alloc.rs
Last active January 11, 2025 14:55 — forked from rust-play/playground.rs
usize_alloc.rs
use std::alloc::{alloc, dealloc, Layout};
//use std::fmt::Pointer;
fn main() -> () {
// Number of elements to allocate
const NUM_ELEMENTS: usize = 100;
// Size of each element in bytes
const ELEMENT_SIZE: usize = 64; // Assuming 4 bytes per element (e.g., 32-bit integer)
// Calculate total size in bytes
@RandyMcMillan
RandyMcMillan / usize_alloc.rs
Last active January 11, 2025 14:54 — forked from rust-play/playground.rs
usize_alloc.rs
use std::alloc::{alloc, dealloc, Layout};
//use std::fmt::Pointer;
fn main() -> () {
// Number of elements to allocate
const NUM_ELEMENTS: usize = 100;
// Size of each element in bytes
const ELEMENT_SIZE: usize = 1024; // Assuming 4 bytes per element (e.g., 32-bit integer)
// Calculate total size in bytes
@RandyMcMillan
RandyMcMillan / usize_alloc.rs
Last active January 11, 2025 15:36 — forked from rust-play/playground.rs
usize_alloc.rs
use std::alloc::{alloc, dealloc, Layout};
//use std::fmt::Pointer;
fn main() -> () {
// Number of elements to allocate
const NUM_ELEMENTS: usize = 1024;
// Size of each element in bytes
const ELEMENT_SIZE: usize = 64; // Assuming 4 bytes per element (e.g., 32-bit integer)
// Calculate total size in bytes
@RandyMcMillan
RandyMcMillan / not_random.rs
Created January 13, 2025 21:36 — forked from rust-play/playground.rs
Code shared from the Rust Playground
fn main() {
let num1 = vec![2, 3];
let num2 = vec![2, 3];
let address1 = &num1 as *const Vec<i32>;
let address2 = &num2 as *const Vec<i32>;
let number1 = address1 as i32;
let number2 = address2 as i32;
println!("{}", number1 % 13);
println!("{}", number2 % 13);
@RandyMcMillan
RandyMcMillan / tcp_stream.rs
Created January 14, 2025 00:12 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use std::fmt;
use std::net::{TcpStream, SocketAddr, ToSocketAddrs};
use std::io::prelude::*;
use std::collections::*;
#[derive(Debug)]
pub enum Method {
GET,
POST,
PUT,
@RandyMcMillan
RandyMcMillan / threads.rs
Last active January 18, 2025 15:13 — forked from rust-play/playground.rs
threads.rs
use std::thread;
const NTHREADS: u32 = 10;
// This is the `main` thread
fn main() {
// Make a vector to hold the children which are spawned.
let mut children = vec![];
for i in 0..NTHREADS {
@RandyMcMillan
RandyMcMillan / threads_channel.rs
Last active January 18, 2025 15:17 — forked from rust-play/playground.rs
threads_channel.rs
use std::sync::mpsc::{Sender, Receiver};
use std::sync::mpsc;
use std::thread;
static NTHREADS: i32 = 3;
fn main() {
// Channels have two endpoints: the `Sender<T>` and the `Receiver<T>`,
// where `T` is the type of the message to be transferred
// (type annotation is superfluous)

Reusable taproot addresses

Abstract

This document proposes a new scheme to avoid address reuse while retaining some of the convenience of address reuse, keeping recoverability purely from Bitcoin time chain and avoiding visible fingerprint. The scheme has negligible average overhead.

Motivation