MCPcopy
hub / github.com/prometheus/client_js / fastHashObject

Function fastHashObject

lib/util.js:70–86  ·  view source on GitHub ↗
(keys, labels)

Source from the content-addressed store, hash-verified

68};
69
70function fastHashObject(keys, labels) {
71 if (keys.length === 0) {
72 return '';
73 }
74
75 let hash = '';
76
77 for (let i = 0; i < keys.length; i++) {
78 const key = keys[i];
79 const value = labels[key];
80 if (value === undefined) continue;
81
82 hash += `${key}:${value},`;
83 }
84
85 return hash;
86}
87
88function hashObject(labels, labelNames) {
89 // We don't actually need a hash here. We just need a string that

Callers 1

hashObjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected