UNPKG
@lg-tools/crawler
Version:
latest (0.0.2)
0.0.2
0.0.1
0.0.0
Crawler for MongoDB documentation and other sites
@lg-tools/crawler
/
src
/
utils
/
createChecksum.ts
8 lines
(6 loc)
•
262 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
import
crypto
from
'crypto'
;
// Create MD5 checksum from title, URL, and page content
export
const
createChecksum = (
url
:
string
,
content
:
string
):
string
=>
{
const
data =
`
${url}
|
${content}
`
;
return
crypto.
createHash
(
'md5'
).
update
(data).
digest
(
'hex'
); };