MCPcopy Create free account
hub / github.com/argumentcomputer/ix / str

Method str

crates/common/src/env.rs:164–171  ·  view source on GitHub ↗

Constructs a name by appending a string component to `pre`.

(pre: Name, s: String)

Source from the content-addressed store, hash-verified

162
163 /// Constructs a name by appending a string component to `pre`.
164 pub fn str(pre: Name, s: String) -> Self {
165 let mut hasher = blake3::Hasher::new();
166 hasher.update(&[NSTR]);
167 hasher.update(pre.get_hash().as_bytes());
168 hasher.update(s.as_bytes());
169 let hash = hasher.finalize();
170 Name(Arc::new(NameData::Str(pre, s, hash)))
171 }
172
173 /// Constructs a name by appending a numeric component to `pre`.
174 pub fn num(pre: Name, n: Nat) -> Name {

Callers

nothing calls this directly

Calls 4

NameClass · 0.85
as_bytesMethod · 0.80
get_hashMethod · 0.80
finalizeMethod · 0.80

Tested by

no test coverage detected