Function
iterableWith
(seed: number, f: (el: any) => number)
Source from the content-addressed store, hash-verified
| 448 | export const structure = <A extends object>(o: A) => structureKeys(o, getAllObjectKeys(o)) |
| 449 | |
| 450 | const iterableWith = (seed: number, f: (el: any) => number) => (iter: Iterable<any>) => { |
| 451 | let h = seed |
| 452 | for (const element of iter) { |
| 453 | h ^= f(element) |
| 454 | } |
| 455 | return optimize(h) |
| 456 | } |
| 457 | |
| 458 | /** |
| 459 | * Computes a hash value for an iterable by hashing all of its elements. |
Tested by
no test coverage detected