-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdeno_binary.deno.txt
57 lines (43 loc) · 2.25 KB
/
deno_binary.deno.txt
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
┏━━━━━━━━━━━━━━━━━┓
┃ DENO_BINARY ┃
┗━━━━━━━━━━━━━━━━━┛
VERSION ==> #See deno doc
#Browser compatible
┌─────────────┐
│ COMPARE │
└─────────────┘
@std/crypto/timing-safe-equal
timingSafeEqual
(ARRBUFFER|DATAVIEW|TYPEDARR,
ARRBUFFER|DATAVIEW|TYPEDARR2) #Compare values.
->BOOL #Random performance to prevent timing attacks
@std/bytes/equals
equals(UINT8ARR, UINT8ARR2)->BOOL #Like STR === STR2 but using UINT8ARR
#Fast
┌──────────┐
│ FIND │
└──────────┘
@std/bytes/index-of-needle
indexOfNeedle
(UINT8ARR, UINT8ARR2[, NUM]) #Like STR.indexOf(STR2) but using UINT8ARR
->NUM2 #Only start search at index NUM (def: 0)
@std/bytes/last-index-of-needle
lastIndexOfNeedle(...) #Same but reverse
@std/bytes/includes-needle
includesNeedle
(UINT8ARR, UINT8ARR2[, NUM])
->BOOL #Like STR.includes() but using UINT8ARR
@std/bytes/starts|end-with
starts|endsWith
(UINT8ARR, UINT8ARR2)->BOOL #Like STR.starts|endsWith() but using UINT8ARR
┌──────────┐
│ COPY │
└──────────┘
@std/bytes/concat
concat(UINT8ARR_ARR)->UINTARR2 #Like STR + STR2 but using UINT8ARR
@std/bytes/copy
copy(UINT8ARR, UINT8ARR2[, NUM]) #Copy UINT8ARR bytes onto UINT8ARR2 at offset NUM (def: 0)
->NUM2 #Returns NUM of bytes copied
# - this is < UINT8ARR.length if UINT8ARR2 was not big enough (at given offset)
@std/bytes/repeat
repeat(UINT8ARR, NUM)->UINT8ARR2 #Like STR.repeat() but using UINT8ARR