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 * as Randomness from '../index'; | |
describe('Generates random', () => { | |
it('Generates random bytes', async () => { | |
const data = await Randomness.random(); | |
expect(data).not.toBe(null); | |
}); | |
it('Generates random bytes of given length ', async () => { | |
const data = await Randomness.random(100); | |
expect(data.length).toBe(100); |
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 { NativeModules } from 'react-native'; | |
import { decodeAsBytes } from './base64'; | |
const { Randomness } = NativeModules; | |
export const random = async (length: number = 16): Promise<Uint8Array> => { | |
const base64: string = await Randomness.random(length); | |
const data = decodeAsBytes(base64); | |
return data; |
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 newLocal = | |
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; | |
/* eslint-disable no-bitwise */ | |
const keyStr = newLocal; | |
export const encode = (input: string) => { | |
var output = []; | |
var chr1, chr2, chr3; | |
var enc1, enc2, enc3, enc4; | |
var i = 0; |
https://stackoverflow.com/questions/48993286/is-it-possible-to-route-traffic-to-a-specific-pod?rq=1
You can guarantee session affinity with services, but not as you are describing. So, your customers 1-1000 won't use pod-1, but they will use all the pods (as a service makes a simple load balancing), but each customer, when gets back to hit your service, will be redirected to the same pod.
Note: always within time specified in (default 10800):
- A single style for our projects and others
- Minimize customization - Any decided-upon style is better than one we can bikeshed
- Minimize friction - Instead of warnings, sources are formatted automatically on commit and on save inside your editor
- Minimize files - These three or four files need only be at the top level of the monorepo... nothign in the subdirs
- Prettier, no semicolons - Because you don't need them and they add unnecessary visual clutter. Prettier will figure out when they're needed for you.
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
version: 2 | |
workflows: | |
version: 2 | |
build: | |
jobs: | |
- test | |
jobs: | |
test: |
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
ssh-keygen -t rsa -b 4096 -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
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 AWS = require("aws-sdk"); | |
const {link} = require("linkfs"); | |
const mock = require('mock-require'); | |
const fs = require('fs'); | |
const tmpDir = require('os').tmpdir(); | |
exports.handler = (event, context) => { | |
rewriteFs(); | |
invokeGatsby(context); | |
} |