# gene ## Bitcoin Private/Public Key and Address Example

Generating a private key from a random number Creating a bitcoin key is essentially the same as “Pick a number between 1 and 2256.” The exact method you use to pick that number does not matter as long as it is not predictable or repeatable. More precisely, the private key can be any number between …

## JavaScript: Number.EPSILON and Number.MAX_SAFE_INTEGER

EPSILON The Number.EPSILON property represents the difference between 1 and the smallest floating point number greater than 1 > Number.EPSILON == Math.pow(2, -52) true Use Number.EPSILON to test floating point number equality. x = 0.2; y = 0.3; z = 0.1; equal = (Math.abs(x – y + z) < Number.EPSILON); https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON MAX_SAFE_INTEGER & MIN_SAFE_INTEGER The MAX_SAFE_INTEGER constant has a …

## Non-cryptographic Hash Functions

See: List of non-cryptographic hash functions Pearson hashing Pearson hashing is a hash function designed for fast execution on processors with 8-bit registers. This hash function is a CBC-MAC that uses an 8-bit substitution cipher implemented via the substitution table. An 8-bit cipher has negligible cryptographic security, so the Pearson hash function is not cryptographically strong, but it is useful for implementing hash tables or as a data integrity check …

## Python: pearson_hashing.py

\$ cat pearson_hashing.py from random import shuffle example_table = list(range(0, 256)) shuffle(example_table) def hash8(message, table): hash = len(message) % 256 for c in message: #hash = table[(hash+ord(c)) % 256] print(f’for c=\'{c}\’, ord(c)={ord(c)}: {hash} ^ {ord(c)} => {hash ^ ord(c)} and table[hash ^ ord(c)] = {table[hash ^ ord(c)]}’) hash = table[hash ^ ord(c)] return hash if …

## Digital Signature Flow Diagram

Taken from: https://www.docusign.com/how-it-works/electronic-signature/digital-signature/digital-signature-faq

## Bloom Filters in Redis

Probabilistic (P11C) data structure https://github.com/guyroyse/understanding-probabilistic-data-structures/blob/master/code/bloom-filter/javascript/bloom.js https://github.com/guyroyse/understanding-probabilistic-data-structures/blob/master/slides/understanding-probabilistic-data-structures.pdf

## AWS CDK Cheat Sheet

Documentation https://docs.aws.amazon.com/cdk/latest/guide/stack_how_to_create_multiple_stacks.html https://docs.aws.amazon.com/cdk/latest/guide/get_context_var.html https://docs.aws.amazon.com/cdk/latest/guide/testing.html CDK Constructs Library TypeScript API Reference Best Practices github.com/kevinslin/open-cdk Examples github.com/kolomied/awesome-cdk github.com/cloudcomponents/cdk-constructs/tree/master/examples github.com/aws-samples/aws-cdk-examples github.com/blndspt/aws-full-stack-template github.com/awslabs/aws-full-stack-template github.com/aws-samples/aws-bookstore-demo-app bobbyhadz.com/blog/how-does-aws-cdk-work bobbyhadz.com/blog/cdk-constructs-tutorial bobbyhadz.com/blog/aws-cdk-identifiers bobbyhadz.com/blog/how-to-use-context-aws-cdk bobbyhadz.com/blog/aws-cdk-parameters-example bobbyhadz.com/blog/aws-cdk-vpc-example bobbyhadz.com/blog/aws-cdk-security-group-example Some Gotchas When synthesizing an AWS CDK stack, I get the message –app is required either in command-line, in cdk.json or in ~/.cdk.json This message usually means that you …