solana-atomic-hash 0.1.0

A lock-free atomic wrapper for Solana Hash, enabling thread-safe concurrent load and store operations.
Documentation
  • Coverage
  • 0%
    0 out of 6 items documented0 out of 5 items with examples
  • Size
  • Source code size: 19.0 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 50.8 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 6s Average build duration of successful builds.
  • all releases: 6s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • ibg101/solana-atomic-hash
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ibg101

solana-atomic-hash

solana-atomic-hash is a small Rust library providing a lock-free atomic wrapper around Solana 32-byte Hash values. It enables thread-safe, concurrent load and store of hashes using an internal array of AtomicU64 values.

Features

  • Atomic load/store operations for Solana Hash without locks
  • Represents 32-byte hashes as four atomic u64 elements
  • Compatible with solana-hash crate's Hash type
  • Lightweight and minimal dependencies

Usage

use solana_hash::Hash;
use solana_atomic_hash::AtomicHash;
use std::sync::atomic::Ordering;

let hash = Hash::from([101u8; 32]);
let atomic_hash = AtomicHash::new(&hash);

let loaded_hash = atomic_hash.load(Ordering::Relaxed);
assert_eq!(hash, loaded_hash);

Author

Ivan Bets ivan.bets17@gmail.com