MCPcopy Create free account
hub / github.com/dfinity/orbit / sha256_hex

Function sha256_hex

tests/integration/src/utils.rs:939–947  ·  view source on GitHub ↗

Converts the given data to a SHA-256 hash and returns it as a hex string.

(data: &[u8])

Source from the content-addressed store, hash-verified

937
938/// Converts the given data to a SHA-256 hash and returns it as a hex string.
939pub fn sha256_hex(data: &[u8]) -> String {
940 let mut hasher = sha2::Sha256::new();
941
942 hasher.update(data);
943
944 let result = hasher.finalize();
945
946 hex::encode(result)
947}
948
949pub fn upload_canister_modules(env: &PocketIc, control_panel_id: Principal, controller: Principal) {
950 // upload upgrader

Callers

nothing calls this directly

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected