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
import { Model, IModelOptions } from 'acey' | |
class Device extends Model { | |
constructor(initialState: any, options: IOptions){ | |
super(initialState, options) | |
} | |
brand = (): string => this.state.brand | |
serie = (): string => this.state.serie |
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
import LocalStore from 'acey-node-store' | |
import { Model, config } from 'acey' | |
class M extends Model { | |
constructor(initialState, options){ | |
super(initialState, options) | |
} | |
getRandomValue = () => this.state.random |
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
BASIC BINARY SYSTEM | |
There are 4 types of int: | |
- Int8 : 8 bytes | 1 octet. [max: (2^8) / 2 - 1, min: (2^8) / 2 * -1] | |
- Int16 : 16 bytes | 2 octets. [max: (2^16) / 2 - 1, min: (2^16) / 2 * -1] | |
- Int32 : 32 bytes | 4 octets [max: (2^32) / 2 - 1, min: (2^32) / 2 * -1] | |
- Int64 : 64 bytes | 8 octets [max: (2^64) / 2 - 1, min: (2^64) / 2 * -1] | |
Examples with Int8: |
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 TWO = BigInt(2) | |
const ONE = BigInt(1) | |
const ZERO = BigInt(0) | |
const MINUS = BigInt(-1) | |
const MAX_UINT_8 = BigInt(256) | |
const MAX_UINT_16 = BigInt(65536) | |
const MAX_UINT_32 = BigInt(4294967296) | |
const MAX_UINT_64 = BigInt(18446744073709551616) |
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 MAX_UINT_8 = BigInt(256) | |
const MAX_UINT_16 = BigInt(65536) | |
const MAX_UINT_32 = BigInt(4294967296) | |
const MAX_UINT_64 = BigInt(18446744073709551616) | |
export const ByteArrayToInt = (value: Uint8Array, isNegative: boolean): BigInt => { | |
let n = BigInt(0); | |
let MAX = MAX_UINT_8 | |
switch(value.length){ | |
case 1: |
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
import mnemonic | |
english = ["abandon", "ability", "able", "about", "above", "absent", "absorb", "abstract", "absurd", "abuse", "access", "accident", "account", "accuse", "achieve", "acid", "acoustic", "acquire", "across", "act", "action", "actor", "actress", "actual", "adapt", "add", "addict", "address", "adjust", "admit", "adult", "advance", "advice", "aerobic", "affair", "afford", "afraid", "again", "age", "agent", "agree", "ahead", "aim", "air", "airport", "aisle", "alarm", "album", "alcohol", "alert", "alien", "all", "alley", "allow", "almost", "alone", "alpha", "already", "also", "alter", "always", "amateur", "amazing", "among", "amount", "amused", "analyst", "anchor", "ancient", "anger", "angle", "angry", "animal", "ankle", "announce", "annual", "another", "answer", "antenna", "antique", "anxiety", "any", "apart", "apology", "appear", "apple", "approve", "april", "arch", "arctic", "area", "arena", "argue", "arm", "armed", "armor", "army", "around", "arrange", "arrest", "arrive", "arrow", "art", "artefac |
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
import { Model, Joi, Collection } from 'elzeard' | |
export class UserModel extends Model { | |
static schema = Joi.object({ | |
id: Joi.number().autoIncrement().primaryKey() | |
username: Joi.string().min(3).max(20).lowercase().required().unique(), | |
}) | |
constructor(initialState: any, options: any){ |
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
{ | |
"fingerprint": { | |
"screen": { | |
"availHeight": 790, | |
"availWidth": 1440, | |
"pixelDepth": 30, | |
"height": 900, | |
"width": 1440, | |
"availTop": 25, | |
"availLeft": 0, |