fn initMaybeSeed(comptime Hash: anytype, seed: anytype) Hash Hashseed16
17
18
19
20
21
22
23fn initMaybeSeed(comptime Hash: anytype, seed: anytype) Hash {
const HashFn = @typeInfo(@TypeOf(Hash.init)).@"fn";
if (HashFn.param_types.len == 1) {
return Hash.init(@intCast(seed));
} else {
return Hash.init();
}
}