This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Just to show what I had to deal with. Do NOT copy. React-pdf encourages you to import font from CDN directly. | |
import LatoBold from "../../../assets/fonts/Lato-Bold.ttf"; | |
import LatoLight from "../../../assets/fonts/Lato-Light.ttf"; | |
import Lato from "../../../assets/fonts/Lato-Regular.ttf"; | |
import openSansFont from "../../../assets/fonts/OpenSans-Light.ttf"; | |
export const PDF_BOLD_FONT_NAME = "Lato Bold"; | |
export const PDF_LIGHT_FONT_NAME = "Lato Light"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Before moving to Keycloak, I used the following code to generate user credentials | |
const crypto = require("crypto"); | |
const salt = crypto.randomBytes(16).toString("hex"); | |
const hash = crypto | |
.pbkdf2Sync(password, this.salt, 10000, 64, "sha512") | |
.toString("hex"); | |
// HEADS UP: Even though the salt was created as random bytes and then converted to its hex representation, | |
// the hashing function interpreted it as UTF-8. So this yields the same hash as the following: | |
const sameHash = crypto |