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
'use strict'; | |
const crypto = require('crypto'); | |
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters) | |
const IV_LENGTH = 16; // For AES, this is always 16 | |
function encrypt(text) { | |
let iv = crypto.randomBytes(IV_LENGTH); | |
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv); |
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
<code_scheme name="Airbnb"> | |
<option name="RIGHT_MARGIN" value="100" /> | |
<option name="HTML_ATTRIBUTE_WRAP" value="4" /> | |
<option name="HTML_ELEMENTS_TO_INSERT_NEW_LINE_BEFORE" value="" /> | |
<option name="HTML_ENFORCE_QUOTES" value="true" /> | |
<DBN-PSQL> | |
<case-options enabled="false"> | |
<option name="KEYWORD_CASE" value="lower" /> | |
<option name="FUNCTION_CASE" value="lower" /> | |
<option name="PARAMETER_CASE" value="lower" /> |
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
const requestURL = 'https://jsonplaceholder.typicode.com/users' | |
function sendRequest(method, url, body = null) { | |
const headers = { | |
'Content-Type': 'application/json' | |
} | |
return fetch(url, { | |
method: method, | |
body: JSON.stringify(body), |