UNPKG

1.2 kBPlain TextView Raw
1const Buffer = require('buffer').Buffer
2import BN from 'bn.js'
3
4/**
5 * The max integer that this VM can handle
6 */
7export const MAX_INTEGER: BN = new BN(
8 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff',
9 16
10)
11
12/**
13 * 2^256
14 */
15export const TWO_POW256: BN = new BN(
16 '10000000000000000000000000000000000000000000000000000000000000000',
17 16
18)
19
20/**
21 * Keccak-256 hash of null
22 */
23export const KECCAK256_NULL_S: string =
24 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'
25
26/**
27 * Keccak-256 hash of null
28 */
29export const KECCAK256_NULL: Buffer = Buffer.from(KECCAK256_NULL_S, 'hex')
30
31/**
32 * Keccak-256 of an RLP of an empty array
33 */
34export const KECCAK256_RLP_ARRAY_S: string =
35 '1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347'
36
37/**
38 * Keccak-256 of an RLP of an empty array
39 */
40export const KECCAK256_RLP_ARRAY: Buffer = Buffer.from(KECCAK256_RLP_ARRAY_S, 'hex')
41
42/**
43 * Keccak-256 hash of the RLP of null
44 */
45export const KECCAK256_RLP_S: string =
46 '56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
47
48/**
49 * Keccak-256 hash of the RLP of null
50 */
51export const KECCAK256_RLP: Buffer = Buffer.from(KECCAK256_RLP_S, 'hex')