Skip to content

Instantly share code, notes, and snippets.

View vojtechmares's full-sized avatar
:octocat:
writing some fancy code

Vojtěch Mareš vojtechmares

:octocat:
writing some fancy code
View GitHub Profile
@vojtechmares
vojtechmares / generate-encryption-key.ts
Created February 24, 2023 18:59
Generate cryptographically safe random 32 byte string (AES-256 encryption key), base64 encoded
#!/usr/bin/env deno run
import { encode as base64encode } from 'https://deno.land/std@0.178.0/encoding/base64.ts';
// Generates a random 32 byte encryption key string
function generateEncryptionKey() {
const buf = new Uint8Array(32 / 2); // 32 bytes = 64 hex characters
crypto.getRandomValues(buf);
let result = "";
@vojtechmares
vojtechmares / keybase.md
Created January 7, 2022 12:05
keybase.md

Keybase proof

I hereby claim:

  • I am vojtechmares on github.
  • I am vojtechmares (https://keybase.io/vojtechmares) on keybase.
  • I have a public key ASDM5Zlf8dDnumHYR9Wz7oez1w9cer1wTExNLMPjS-DhLwo

To claim this, I am signing this object:

package main
import (
"fmt"
"strconv"
)
func max(a, b int) int {
if a >= b {
return a
Google Chrome 85.0.4173.0 (Official Build) dev (64-bit) (cohort: Dev)
Revision b686e01ff9836e7713952e8956d76cff8d9fa19b-refs/branch-heads/4173@{#1}
OS Windows 10 OS Version 2004 (Build 19041.329)
JavaScript V8 8.5.156
Flash 32.0.0.387 C:\Users\Vojta\AppData\Local\Google\Chrome Dev\User Data\PepperFlash\32.0.0.387\pepflashplayer.dll
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4173.0 Safari/537.36
Command Line "C:\Program Files (x86)\Google\Chrome Dev\Application\chrome.exe" --flag-switches-begin --flag-switches-end --enable-audio-service-sandbox
Executable Path C:\Program Files (x86)\Google\Chrome Dev\Application\chrome.exe
Profile Path C:\Users\Vojta\AppData\Local\Google\Chrome Dev\User Data\Default
Variations af81735d-3f4a17df