Skip to content

Instantly share code, notes, and snippets.

# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name YOUR_DOMAIN.COM;
root /usr/share/nginx/html;
index index.html index.htm;
location / {
try_files $uri @prerender;
FROM nginx
RUN apt-get update && apt-get install -y python curl && curl -O <https://bootstrap.pypa.io/get-pip.py> && \\
python get-pip.py
RUN update-ca-certificates
WORKDIR /nginx
ADD default.conf /etc/nginx/conf.d/default.conf
export const encryptionConfig = {
JsonWebTokenKey: 'unity-super-long-secret',
ChaChaEncryptionKey: 'f2ZWDvhBXFSxKXpCl0wg9aEZnuXfA+B2c+5RU8wWbfQ=',
ChaChaSigPublicKey: '6T7iL581iPWn1X/Nm8AD2PNRFDqGyGlRfslNy0SD63M=',
ChaChaSigPrivateKey: 'UDPW1Td0BfG4bFINTU85mrwRp9ipd2iqKg/0n8hkFWbpPuIvnzWI9afVf82bwAPY81EUOobIaVF+yU3LRIPrcw==',
};
export const encryptionConfig = {
JsonWebTokenKey: 'unity-super-long-secret',
ChaChaEncryptionKey: 'f2ZWDvhBXFSxKXpCl0wg9aEZnuXfA+B2c+5RU8wWbfQ=',
ChaChaSigPublicKey: '6T7iL581iPWn1X/Nm8AD2PNRFDqGyGlRfslNy0SD63M=',
ChaChaSigPrivateKey: 'UDPW1Td0BfG4bFINTU85mrwRp9ipd2iqKg/0n8hkFWbpPuIvnzWI9afVf82bwAPY81EUOobIaVF+yU3LRIPrcw==',
};
// encryptionService
import * as config from '../config/EncryptionConfig'
import * as sodium from 'sodium-native';
import * as md5 from 'md5';
import * as crypto from 'crypto';
export class EncryptionService {
public nonce: number = 0;
public timeout: number;
public lastRequest: number;
private sodium: any;
import {assert} from "chai";
import {EncryptionService} from "../Services/EncryptionService";
import * as crypto from 'crypto';
describe('encryption', () => {
const encryptionService: EncryptionService = new EncryptionService();
// 1000 * 10 Loops: 5.2 seconds
it('encryption performance test', () => {
const loop = 1000 * 10; // should use 1000 * 10