View main.go
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
// Testrun with: | |
// go build *.go && docker run --rm -v "$PWD":/var/task lambci/lambda:go1.x main '{"prefix":"23727483927892"}' | |
// Deploy by: | |
// zip main.zip main | |
// upload main.zip to https://console.aws.amazon.com/lambda/home | |
package main | |
import ( | |
"context" |
View LZW.js
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 fcp = String.fromCodePoint; | |
const L = "length"; | |
/** | |
* @param {Uint8Array} input | |
* @returns {Uint8Array} | |
*/ | |
function compress(input) { | |
const codewords = []; | |
const dictionary = new Map(); |
View cm_method.sage
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
def cm_method(q,t): | |
""" | |
Given a prime power q and integer t with |t| <= 2sqrt(q), | |
returns an Elliptic curve over GF(q) with q + 1 - t points. | |
""" | |
n = q + 1 - t | |
d = t^2 - 4*q | |
K = QuadraticField(d) | |
j = K.hilbert_class_polynomial().any_root() | |
E = EllipticCurve_from_j(GF(q)(j)) |
View sha256.js
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
/** | |
* Given a sting s, return the SHA-256 digest of s | |
* (encoded as a UTF-16-LE byte array) in hex form. | |
* @param {string} s | |
* @returns {string} | |
* | |
* python -c 'import hashlib; print(hashlib.sha256("a🐦".encode("utf-16-le")).hexdigest())' | |
* 49f1ecba591ec4ae7a049570bd21b97dc77d42659f3fbe70a34a8f02ebacee17 | |
* | |
* python -c 'import hashlib; print(hashlib.sha256("$€𐐷𤭢".encode("utf-16-le")).hexdigest())' |
View linear-algebra.c
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
#include "linear-algebra.h" | |
#define mat_val(i, j) A[i * m + j] | |
#define swap_values(a, b) t = b, b = a, a = t | |
#define swap_rows(_i1, _i2) \ | |
for (int k = 0; k < m; k++) \ | |
swap_values(mat_val(_i1, k), mat_val(_i2, k)); | |
int solve(Element *A, Element *b, int n, int m, Element *x) | |
{ |
View turing-machine.ts
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 enum Direction { | |
L = 0, | |
R = 1, | |
} | |
const enum Alphabet { | |
A = 0, | |
B = 1, | |
} | |
type StateOutput = [ | |
Alphabet, // write |
View letter.tex
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
\documentclass[12pt]{letter} | |
\date{\today} | |
\signature{FROMWHO???} | |
\address{ | |
FROMWHERE??? \\ | |
{\tt CONTACTEMAIL???} | |
} |
View Curve25519.sage
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
# Curve25519 | |
p = 2^255 - 19 | |
N = 8*(2^252 + 27742317777372353535851937790883648493) | |
E = EllipticCurve(GF(p),[0,486662,0,1,0]) | |
G = E.lift_x(9) | |
assert E.count_points() == N | |
assert G.order() == N/8 |
View template.tex
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
\documentclass{article} | |
\usepackage{amsmath,amssymb,amsthm,amsfonts} | |
\usepackage{xcolor} | |
\newcommand{\public}[1]{\textcolor[rgb]{0.024,0.408,0.024}{#1}} | |
\newcommand{\private}[1]{\textcolor[rgb]{0.661,0.035,0.035}{#1}} | |
\newcommand{\FF}{\mathbb{F}} | |
\newcommand{\QQ}{\mathbb{Q}} | |
\newcommand{\ZZ}{\mathbb{Z}} |
View index.html
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<title>Latex to Unicode</title> | |
<link | |
rel="stylesheet" | |
href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic" | |
/> |
NewerOlder