* Returns a stable hash for the generated sources and runtime requirements, * computing and caching it on first access. * @param {Module} module the module * @param {RuntimeSpec} runtime runtime(s) * @returns {string} hash of the code generation
(module, runtime)
| 150 | * @returns {string} hash of the code generation |
| 151 | */ |
| 152 | getHash(module, runtime) { |
| 153 | const info = this.get(module, runtime); |
| 154 | if (info.hash !== undefined) return info.hash; |
| 155 | const hash = createHash(this._hashFunction); |
| 156 | for (const [type, source] of info.sources) { |
| 157 | hash.update(type); |
| 158 | source.updateHash(hash); |
| 159 | } |
| 160 | if (info.runtimeRequirements) { |
| 161 | for (const rr of info.runtimeRequirements) hash.update(rr); |
| 162 | } |
| 163 | return (info.hash = hash.digest(class="st">"hex")); |
| 164 | } |
| 165 | |
| 166 | /** |
| 167 | * Stores a code generation result for a module/runtime pair, creating the |
nothing calls this directly
no test coverage detected