Skip to content

Instantly share code, notes, and snippets.

const crypto = require("crypto");
getHash = (content) => crypto.createHash("sha256")
.update(content)
.digest("hex");
var start = Date.now();
// A million hashes take ~3000ms on my Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz.
// You might want to increase this value.
@jbarguil
jbarguil / example.dart
Last active August 23, 2021 15:50
Dart test
class A {
String method() => "value";
}
class B {
A? field;
B([this.field]); // Using [] to denote optional parameter.
Map<String, String?> toJson() {