MCPcopy Create free account
hub / github.com/foliojs/pdfkit / generateFileID

Method generateFileID

lib/security.js:15–27  ·  view source on GitHub ↗
(info = {})

Source from the content-addressed store, hash-verified

13
14class PDFSecurity {
15 static generateFileID(info = {}) {
16 let infoStr = `${info.CreationDate.getTime()}\n`;
17
18 for (let key in info) {
19 // eslint-disable-next-line no-prototype-builtins
20 if (!info.hasOwnProperty(key)) {
21 continue;
22 }
23 infoStr += `${key}: ${info[key].valueOf()}\n`;
24 }
25
26 return Buffer.from(md5Hash(infoStr));
27 }
28
29 static generateRandomWordArray(bytes) {
30 return randomBytes(bytes);

Callers 2

constructorMethod · 0.80
security.spec.jsFile · 0.80

Calls 1

md5HashFunction · 0.90

Tested by

no test coverage detected