[info] Performance report: Report Not Uploaded to S3
[info] 1439 total requests (1439 succeeded, 0 failed).
[info] Min Time: 97ms
[info] Max Time: 7512ms
[info] Mean Time: 833ms
[info] Std Deviation: 760ms
[info] 50th Percentile: 640ms
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
import org.allenai.sqs.reader._ | |
import scala.collection.parallel.CollectionConverters._ | |
import scala.concurrent.ExecutionContext | |
import scala.collection.parallel.ExecutionContextTaskSupport | |
import java.util.concurrent.Executors | |
import com.amazonaws.services.sqs.AmazonSQSClientBuilder | |
object Main { | |
val cores = Runtime.getRuntime().availableProcessors() |
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
import $ivy.`io.circe::circe-core:0.12.3` | |
import $ivy.`io.circe::circe-generic:0.12.3` | |
import $ivy.`io.circe::circe-parser:0.12.3` | |
import $ivy.`org.scala-lang.modules::scala-parallel-collections:1.0.0` | |
import ammonite.ops._ | |
import scala.collection.parallel.CollectionConverters._ | |
import io.circe._, io.circe.generic.auto._, io.circe.parser._, io.circe.syntax._ | |
import scala.jdk.CollectionConverters._ | |
import scala.util._ |
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
case class LibraryTag( | |
id: Int = LibraryTag.NEW_TAG_ID_PLACEHOLDER, | |
name: String, | |
createdAtUtc: Timestamp, | |
modifiedAtUtc: Timestamp | |
) | |
case class UpdateTagRequest( | |
name: String | |
) |
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
function encrypt(text, password) { | |
const initVect = crypto.randomBytes(16); | |
const key = getCipherKey(password); | |
const cipher = createCipheriv('aes256', key, initVect); | |
const cipherText = cipher.update(text).digest(); | |
return initVect + ciphertext; | |
} |
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 crypto = require('crypto'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const zlib = require('zlib'); | |
const getCipherKey = require('./getCipherKey'); | |
function decrypt({ file, password }) { | |
// First, get the initialization vector from the file. | |
const readInitVect = fs.createReadStream(file, { end: 15 }); |
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 { Transform } = require('stream'); | |
class AppendInitVect extends Transform { | |
constructor(initVect, opts) { | |
super(opts); | |
this.initVect = initVect; | |
this.appended = false; | |
} | |
_transform(chunk, encoding, cb) { |
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 crypto = require('crypto'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const zlib = require('zlib'); | |
const AppendInitVect = require('./appendInitVect'); | |
const getCipherKey = require('./getCipherKey'); | |
function encrypt({ file, password }) { | |
// Generate a secure, pseudo random initialization vector. |
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
{"lastUpload":"2020-07-03T22:26:04.449Z","extensionVersion":"v3.4.3"} |
NewerOlder