MCPcopy Create free account
hub / github.com/Ray-D-Song/lexe / create_hash_object

Function create_hash_object

modules/llrt_crypto/src/subtle/key_algorithm.rs:1097–1101  ·  view source on GitHub ↗
(ctx: &Ctx<'js>, hash: &ShaAlgorithm)

Source from the content-addressed store, hash-verified

1095}
1096
1097fn create_hash_object<'js>(ctx: &Ctx<'js>, hash: &ShaAlgorithm) -> Result<Object<'js>> {
1098 let hash_obj = Object::new(ctx.clone())?;
1099 hash_obj.set(PredefinedAtom::Name, hash.as_str())?;
1100 Ok(hash_obj)
1101}
1102
1103pub fn hash_mismatch_error<T>(ctx: &Ctx<'_>, hash: &ShaAlgorithm) -> Result<T> {
1104 Err(Exception::throw_message(

Callers 1

as_objectMethod · 0.85

Calls 3

as_strMethod · 0.80
cloneMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected