(resource)
| 13 | } |
| 14 | |
| 15 | async function signByHash(resource) { |
| 16 | const hasher = crypto.createHash("sha1"); |
| 17 | const buffer = await resource.getBuffer(); |
| 18 | |
| 19 | hasher.update(buffer.toString("binary")); |
| 20 | return hasher.digest("hex"); |
| 21 | } |
| 22 | |
| 23 | function getSigner(type) { |
| 24 | type = type || "time"; |