MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / cmd_rand

Function cmd_rand

dstack-util/src/main.rs:230–240  ·  view source on GitHub ↗
(rand_args: RandArgs)

Source from the content-addressed store, hash-verified

228}
229
230fn cmd_rand(rand_args: RandArgs) -> Result<()> {
231 let mut data = vec![0u8; rand_args.bytes];
232 getrandom(&mut data).context("Failed to generate random data")?;
233 if rand_args.hex {
234 data = hex::encode(data).into_bytes();
235 }
236 io::stdout()
237 .write_all(&data)
238 .context("Failed to write random data")?;
239 Ok(())
240}
241
242fn cmd_show_mrs() -> Result<()> {
243 let attestation =

Callers 1

mainFunction · 0.85

Calls 1

encodeFunction · 0.85

Tested by

no test coverage detected