This repository was archived by the owner on Jun 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 273
Expand file tree
/
Copy pathindex.ts
More file actions
69 lines (57 loc) · 2.03 KB
/
index.ts
File metadata and controls
69 lines (57 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
declare module 'ethjs-util' {
/**
* @description Returns a `Boolean` on whether or not the a `String` starts with '0x'
*/
export function isHexPrefixed(str: string): boolean
/**
* @description Removes '0x' from a given `String` if present
*/
export function stripHexPrefix(str: string): string
/**
* @description Pads a `String` to have an even length
*/
export function padToEven(value: string): string
/**
* @description Converts a `Number` into a hex `String`
*/
export function intToHex(i: number): string
/**
* @description Converts an `Number` to a `Buffer`
*/
export function intToBuffer(i: number): Buffer
/**
* @description Get the binary size of a string
*/
export function getBinarySize(str: string): number
/**
* @description Returns TRUE if the first specified array contains all elements
* from the second one. FALSE otherwise. If `some` is true, will
* return true if first specified array contain some elements of
* the second.
*/
export function arrayContainsArray(superset: any[], subset: any[], some?: boolean): boolean
/**
* @description Should be called to get utf8 from it's hex representation
*/
export function toUtf8(hex: string): string
/**
* @description Should be called to get ascii from it's hex representation
*/
export function toAscii(hex: string): string
/**
* @description Should be called to get hex representation (prefixed by 0x) of utf8 string
*/
export function fromUtf8(stringValue: string): string
/**
* @description Should be called to get hex representation (prefixed by 0x) of ascii string
*/
export function fromAscii(stringValue: string): string
/**
* @description getKeys([{a: 1, b: 2}, {a: 3, b: 4}], 'a') => [1, 3]
*/
export function getKeys(params: any[], key: string, allowEmpty?: boolean): any[]
/**
* @description check if string is hex string of specific length
*/
export function isHexString(value: string, length?: number): boolean
}