solana-nostd-sha256

Crates.iosolana-nostd-sha256
lib.rssolana-nostd-sha256
version0.1.3
sourcesrc
created_at2024-09-12 02:49:52.146778
updated_at2024-09-12 10:24:50.240719
descriptionA more efficient implementation of Sha256 for SVM
homepage
repository
max_upload_size
id1372443
size6,004
Dean 利迪恩 (deanmlittle)

documentation

README

Solana NoStd Sha256

A more efficient implementation of Sha256 for SVM.

Installation

cargo add solana-nostd-sha256

Features

  • Adds hash_ref which takes in any type that implements <AsRef<[u8]>>
  • No Hash struct. Returns [u8;32] directly.
  • Makes use of MaybeUninit to skip zero allocations
  • Adds hash_into to let you hash directly into a mutable buffer.

Performance

library function CU cost
nostd-sha256 hashv(&[b"test"]) 100
nostd-sha256 hash(b"test") 105
nostd-sha256 hash_ref("test") 105
solana-program hashv(&[b"test"]) 120
solana-program hash(b"test") 123
Commit count: 0

cargo fmt