Skip to main content

Rust SDK API Reference / Address derivation / get_hashed_name

Function: get_hashed_name()

pub fn get_hashed_name(name: &str) -> Vec<u8>

Defined in: derivation.rs:56

Hashes HASH_PREFIX concatenated with the raw label for SPL Name Service derivation.

Parameters

ParameterTypeDescription
name&strRaw label, including any caller-required prefix.

Returns

The 32-byte hash as Vec<u8>.

Example

use sns_sdk::derivation::get_hashed_name;

assert_eq!(get_hashed_name("example").len(), 32);