Skip to content

Instantly share code, notes, and snippets.

@goghcrow
goghcrow / compiler.ml
Created May 2, 2025 14:23 — forked from MaskRay/compiler.ml
Implementing Functional Languages: a tutorial, Template instantiation
open Syntax
module IntMap = Map.Make(struct type t = int let compare = compare end)
module List = struct
include List
let zip xs ys =
let rec go acc = function
| [], _ | _, [] -> List.rev acc
| x::xs, y::ys -> go ((x,y)::acc) (xs,ys)
@goghcrow
goghcrow / IDObfuscation.java
Created May 26, 2019 23:33 — forked from megayu/IDObfuscation.java
an id obfuscation algorithm to generate a string of length 25
public class IDObfuscation {
private static final char[] ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".toCharArray();
private static final int BASE = ALPHABET.length;
private static final byte[] PADDING = {0x29, 0x28, 0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21, 0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17};
private static final byte NEGATIVE = 0x2A;
private int key;
public IDObfuscation(int key) {
this.key = key;
}