Skip to main content

schema_digest

Function schema_digest 

pub fn schema_digest(schema: &Schema) -> [u8; 32]
Expand description

The canonical identity of schema, as raw SHA-256 bytes.

let schema: cratestack_core::Schema = serde_json::from_str(
    r#"{"datasource":null,"auth":null,"config_blocks":[],"mixins":[],
        "models":[],"types":[],"enums":[],"procedures":[]}"#,
)
.unwrap();
assert_eq!(cratestack_core::schema_digest(&schema).len(), 32);