crema-cli 0.1.0

Blockchain, Crema for Solana
Documentation
1
2
3
4
5
6
7
8
9
use crate::utils::hash;

pub fn sighash(namespace: &str, name: &str) -> [u8; 8] {
    let preimage = format!("{}:{}", namespace, name);

    let mut sighash = [0u8; 8];
    sighash.copy_from_slice(&hash::hash(preimage.as_bytes()).to_bytes()[..8]);
    sighash
}