Let’s keep going with our Rust component for FilterAdult
https://github.com/mozilla/application-services/
Write a tool that can take a list of base64 encoded md5 hashes and produce a .rs file that has those hashes defined as raw bytes, and can be linked into the library
Modify that tool afterwards to also accept a list of base domain strings rather than base64 encoded md5 hashes, so that we can easily update the list
Make it possible for the tool to merely accept additions, or to fully overwrite
Maybe removals too?
Design and write the library. It should ideally just expose the following functions:
isAdultURL function
addDomainToListForTesting
removeDomainFromListForTesting
Our utility can use relevancy components “generate-test-data” utility as an example to work from
For next time:
Read in the .mjs file, strip out what we don’t need, and then convert each string into the byte representation to generate the Rust file that we need.