(integrity, data, { hint = null } = {})
| 28 | } |
| 29 | |
| 30 | async addBuffer(integrity, data, { hint = null } = {}) { |
| 31 | const targets = []; |
| 32 | for (const algo of this.algorithms) { |
| 33 | for (const { digest } of integrity[algo] || []) { |
| 34 | targets.push( |
| 35 | this.strategy.has(algo, digest).then(has => { |
| 36 | if (!has) { |
| 37 | return this.strategy.add(algo, digest, data); |
| 38 | } |
| 39 | }) |
| 40 | ); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | await Promise.all(targets); |
| 45 | |
| 46 | return integrity.toString('base64'); |
| 47 | } |
| 48 | |
| 49 | // XXX: do we even need this? we know which algo folks are asking for. |
| 50 | async get(integrity) { |
no test coverage detected