MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / hash

Function hash

flow-derive/src/utils.rs:18–22  ·  view source on GitHub ↗
(input: &TokenStream)

Source from the content-addressed store, hash-verified

16use syn::{parse::Parser, Field, Fields, Ident, ItemStruct, Type};
17
18pub fn hash(input: &TokenStream) -> u64 {
19 let mut hasher = hash_map::DefaultHasher::new();
20 hasher.write(input.to_string().as_bytes());
21 hasher.finish()
22}
23
24pub fn fields(data: &syn::Data) -> syn::punctuated::Iter<syn::Field> {
25 match data {

Callers

nothing calls this directly

Calls 1

finishMethod · 0.80

Tested by

no test coverage detected