angular-slickgrid 4.2.1 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/LICENSE +20 -20
  2. package/app/modules/angular-slickgrid/components/angular-slickgrid.component.d.ts +2 -2
  3. package/app/modules/angular-slickgrid/extensions/slickRowDetailView.d.ts +0 -2
  4. package/docs/assets/lib/multiple-select/README.md +17 -17
  5. package/esm2020/app/modules/angular-slickgrid/components/angular-slickgrid.component.mjs +14 -14
  6. package/esm2020/app/modules/angular-slickgrid/constants.mjs +1 -1
  7. package/esm2020/app/modules/angular-slickgrid/extensions/index.mjs +1 -1
  8. package/esm2020/app/modules/angular-slickgrid/extensions/slickRowDetailView.mjs +2 -4
  9. package/esm2020/app/modules/angular-slickgrid/global-grid-options.mjs +1 -1
  10. package/esm2020/app/modules/angular-slickgrid/index.mjs +1 -1
  11. package/esm2020/app/modules/angular-slickgrid/models/angularComponentOutput.interface.mjs +1 -1
  12. package/esm2020/app/modules/angular-slickgrid/models/angularGridInstance.interface.mjs +1 -1
  13. package/esm2020/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.mjs +1 -1
  14. package/esm2020/app/modules/angular-slickgrid/models/gridOption.interface.mjs +1 -1
  15. package/esm2020/app/modules/angular-slickgrid/models/index.mjs +1 -1
  16. package/esm2020/app/modules/angular-slickgrid/models/rowDetailView.interface.mjs +1 -1
  17. package/esm2020/app/modules/angular-slickgrid/models/slickGrid.interface.mjs +1 -1
  18. package/esm2020/app/modules/angular-slickgrid/modules/angular-slickgrid.module.mjs +7 -10
  19. package/esm2020/app/modules/angular-slickgrid/services/angularUtil.service.mjs +4 -4
  20. package/esm2020/app/modules/angular-slickgrid/services/bsDropdown.service.mjs +4 -4
  21. package/esm2020/app/modules/angular-slickgrid/services/container.service.mjs +4 -4
  22. package/esm2020/app/modules/angular-slickgrid/services/index.mjs +1 -1
  23. package/esm2020/app/modules/angular-slickgrid/services/translater.service.mjs +4 -4
  24. package/esm2020/app/modules/angular-slickgrid/services/utilities.mjs +1 -1
  25. package/esm2020/app/modules/angular-slickgrid/slickgrid-config.mjs +1 -1
  26. package/esm2020/public_api.mjs +1 -1
  27. package/fesm2015/angular-slickgrid.mjs +32 -37
  28. package/fesm2015/angular-slickgrid.mjs.map +1 -1
  29. package/fesm2020/angular-slickgrid.mjs +32 -37
  30. package/fesm2020/angular-slickgrid.mjs.map +1 -1
  31. package/i18n/en.json +89 -89
  32. package/i18n/fr.json +90 -90
  33. package/{angular-slickgrid.d.ts → index.d.ts} +0 -0
  34. package/package.json +11 -11
  35. package/test/cypress/node_modules/@cypress/request/README.md +1038 -0
  36. package/test/cypress/node_modules/@cypress/xvfb/README.md +48 -0
  37. package/test/cypress/node_modules/@cypress/xvfb/node_modules/debug/README.md +437 -0
  38. package/test/cypress/node_modules/@types/node/README.md +16 -0
  39. package/test/cypress/node_modules/@types/sinonjs__fake-timers/README.md +16 -0
  40. package/test/cypress/node_modules/@types/sizzle/README.md +16 -0
  41. package/test/cypress/node_modules/@types/yauzl/README.md +16 -0
  42. package/test/cypress/node_modules/@types/yauzl/node_modules/@types/node/README.md +16 -0
  43. package/test/cypress/node_modules/aggregate-error/README.md +61 -0
  44. package/test/cypress/node_modules/ansi-colors/README.md +315 -0
  45. package/test/cypress/node_modules/ansi-escapes/README.md +245 -0
  46. package/test/cypress/node_modules/ansi-regex/README.md +78 -0
  47. package/test/cypress/node_modules/ansi-styles/README.md +152 -0
  48. package/test/cypress/node_modules/arch/README.md +71 -0
  49. package/test/cypress/node_modules/asn1/README.md +50 -0
  50. package/test/cypress/node_modules/assert-plus/README.md +162 -0
  51. package/test/cypress/node_modules/astral-regex/README.md +46 -0
  52. package/test/cypress/node_modules/async/README.md +60 -0
  53. package/test/cypress/node_modules/asynckit/README.md +233 -0
  54. package/test/cypress/node_modules/at-least-node/README.md +25 -0
  55. package/test/cypress/node_modules/aws-sign2/README.md +4 -0
  56. package/test/cypress/node_modules/aws4/README.md +183 -0
  57. package/test/cypress/node_modules/balanced-match/README.md +91 -0
  58. package/test/cypress/node_modules/base64-js/README.md +34 -0
  59. package/test/cypress/node_modules/bcrypt-pbkdf/README.md +45 -0
  60. package/test/cypress/node_modules/blob-util/README.md +623 -0
  61. package/test/cypress/node_modules/bluebird/README.md +57 -0
  62. package/test/cypress/node_modules/brace-expansion/README.md +129 -0
  63. package/test/cypress/node_modules/buffer/README.md +410 -0
  64. package/test/cypress/node_modules/buffer-crc32/README.md +47 -0
  65. package/test/cypress/node_modules/cachedir/README.md +27 -0
  66. package/test/cypress/node_modules/caseless/README.md +45 -0
  67. package/test/cypress/node_modules/chalk/README.md +293 -0
  68. package/test/cypress/node_modules/chalk/node_modules/supports-color/README.md +76 -0
  69. package/test/cypress/node_modules/check-more-types/README.md +952 -0
  70. package/test/cypress/node_modules/ci-info/README.md +114 -0
  71. package/test/cypress/node_modules/clean-stack/README.md +76 -0
  72. package/test/cypress/node_modules/cli-cursor/README.md +55 -0
  73. package/test/cypress/node_modules/cli-table3/README.md +218 -0
  74. package/test/cypress/node_modules/cli-truncate/README.md +139 -0
  75. package/test/cypress/node_modules/color-convert/README.md +68 -0
  76. package/test/cypress/node_modules/color-name/README.md +11 -0
  77. package/test/cypress/node_modules/colorette/README.md +102 -0
  78. package/test/cypress/node_modules/colors/README.md +221 -0
  79. package/test/cypress/node_modules/combined-stream/README.md +138 -0
  80. package/test/cypress/node_modules/commander/README.md +737 -0
  81. package/test/cypress/node_modules/common-tags/README.md +687 -0
  82. package/test/cypress/node_modules/core-util-is/README.md +3 -0
  83. package/test/cypress/node_modules/cross-spawn/README.md +96 -0
  84. package/test/cypress/node_modules/cypress/README.md +25 -0
  85. package/test/cypress/node_modules/cypress/mount-utils/README.md +14 -0
  86. package/test/cypress/node_modules/cypress/react/README.md +414 -0
  87. package/test/cypress/node_modules/cypress/vue/README.md +678 -0
  88. package/test/cypress/node_modules/cypress/vue2/README.md +693 -0
  89. package/test/cypress/node_modules/dashdash/README.md +574 -0
  90. package/test/cypress/node_modules/dayjs/README.md +128 -0
  91. package/test/cypress/node_modules/debug/README.md +455 -0
  92. package/test/cypress/node_modules/delayed-stream/README.md +141 -0
  93. package/test/cypress/node_modules/ecc-jsbn/README.md +8 -0
  94. package/test/cypress/node_modules/emoji-regex/README.md +73 -0
  95. package/test/cypress/node_modules/end-of-stream/README.md +54 -0
  96. package/test/cypress/node_modules/enquirer/README.md +1752 -0
  97. package/test/cypress/node_modules/escape-string-regexp/README.md +27 -0
  98. package/test/cypress/node_modules/eventemitter2/README.md +809 -0
  99. package/test/cypress/node_modules/execa/README.md +656 -0
  100. package/test/cypress/node_modules/executable/README.md +64 -0
  101. package/test/cypress/node_modules/extend/README.md +81 -0
  102. package/test/cypress/node_modules/extract-zip/README.md +57 -0
  103. package/test/cypress/node_modules/extract-zip/node_modules/debug/README.md +455 -0
  104. package/test/cypress/node_modules/extsprintf/README.md +46 -0
  105. package/test/cypress/node_modules/fd-slicer/README.md +199 -0
  106. package/test/cypress/node_modules/figures/README.md +139 -0
  107. package/test/cypress/node_modules/forever-agent/README.md +4 -0
  108. package/test/cypress/node_modules/form-data/README.md +234 -0
  109. package/test/cypress/node_modules/fs-extra/README.md +264 -0
  110. package/test/cypress/node_modules/fs.realpath/README.md +33 -0
  111. package/test/cypress/node_modules/get-stream/README.md +124 -0
  112. package/test/cypress/node_modules/getos/README.md +79 -0
  113. package/test/cypress/node_modules/getpass/README.md +32 -0
  114. package/test/cypress/node_modules/glob/README.md +375 -0
  115. package/test/cypress/node_modules/global-dirs/README.md +72 -0
  116. package/test/cypress/node_modules/graceful-fs/README.md +133 -0
  117. package/test/cypress/node_modules/has-flag/README.md +89 -0
  118. package/test/cypress/node_modules/http-signature/README.md +80 -0
  119. package/test/cypress/node_modules/human-signals/README.md +155 -0
  120. package/test/cypress/node_modules/ieee754/README.md +51 -0
  121. package/test/cypress/node_modules/indent-string/README.md +70 -0
  122. package/test/cypress/node_modules/inflight/README.md +37 -0
  123. package/test/cypress/node_modules/inherits/README.md +42 -0
  124. package/test/cypress/node_modules/ini/README.md +102 -0
  125. package/test/cypress/node_modules/is-ci/README.md +50 -0
  126. package/test/cypress/node_modules/is-fullwidth-code-point/README.md +39 -0
  127. package/test/cypress/node_modules/is-installed-globally/README.md +31 -0
  128. package/test/cypress/node_modules/is-path-inside/README.md +63 -0
  129. package/test/cypress/node_modules/is-stream/README.md +57 -0
  130. package/test/cypress/node_modules/is-typedarray/README.md +16 -0
  131. package/test/cypress/node_modules/isexe/README.md +51 -0
  132. package/test/cypress/node_modules/isstream/README.md +66 -0
  133. package/test/cypress/node_modules/jsbn/README.md +175 -0
  134. package/test/cypress/node_modules/json-schema/README.md +3 -0
  135. package/test/cypress/node_modules/json-stringify-safe/README.md +52 -0
  136. package/test/cypress/node_modules/jsonfile/README.md +205 -0
  137. package/test/cypress/node_modules/jsonfile/node_modules/universalify/README.md +76 -0
  138. package/test/cypress/node_modules/jsprim/README.md +287 -0
  139. package/test/cypress/node_modules/lazy-ass/README.md +269 -0
  140. package/test/cypress/node_modules/listr2/README.md +17 -0
  141. package/test/cypress/node_modules/lodash/README.md +39 -0
  142. package/test/cypress/node_modules/lodash.once/README.md +18 -0
  143. package/test/cypress/node_modules/log-symbols/README.md +51 -0
  144. package/test/cypress/node_modules/log-update/README.md +97 -0
  145. package/test/cypress/node_modules/log-update/node_modules/slice-ansi/README.md +66 -0
  146. package/test/cypress/node_modules/log-update/node_modules/wrap-ansi/README.md +97 -0
  147. package/test/cypress/node_modules/lru-cache/README.md +166 -0
  148. package/test/cypress/node_modules/merge-stream/README.md +78 -0
  149. package/test/cypress/node_modules/mime-db/README.md +102 -0
  150. package/test/cypress/node_modules/mime-types/README.md +123 -0
  151. package/test/cypress/node_modules/mimic-fn/README.md +69 -0
  152. package/test/cypress/node_modules/minimatch/README.md +209 -0
  153. package/test/cypress/node_modules/ms/README.md +60 -0
  154. package/test/cypress/node_modules/npm-run-path/README.md +115 -0
  155. package/test/cypress/node_modules/once/README.md +79 -0
  156. package/test/cypress/node_modules/onetime/README.md +94 -0
  157. package/test/cypress/node_modules/ospath/README.md +53 -0
  158. package/test/cypress/node_modules/p-map/README.md +89 -0
  159. package/test/cypress/node_modules/path-is-absolute/README.md +59 -0
  160. package/test/cypress/node_modules/path-key/README.md +61 -0
  161. package/test/cypress/node_modules/pend/README.md +41 -0
  162. package/test/cypress/node_modules/performance-now/README.md +30 -0
  163. package/test/cypress/node_modules/pify/README.md +119 -0
  164. package/test/cypress/node_modules/pretty-bytes/README.md +131 -0
  165. package/test/cypress/node_modules/proxy-from-env/README.md +131 -0
  166. package/test/cypress/node_modules/psl/README.md +215 -0
  167. package/test/cypress/node_modules/pump/README.md +65 -0
  168. package/test/cypress/node_modules/punycode/README.md +122 -0
  169. package/test/cypress/node_modules/qs/README.md +475 -0
  170. package/test/cypress/node_modules/request-progress/README.md +78 -0
  171. package/test/cypress/node_modules/restore-cursor/README.md +26 -0
  172. package/test/cypress/node_modules/rimraf/README.md +101 -0
  173. package/test/cypress/node_modules/rxjs/README.md +147 -0
  174. package/test/cypress/node_modules/rxjs/_esm2015/README.md +147 -0
  175. package/test/cypress/node_modules/rxjs/_esm5/README.md +147 -0
  176. package/test/cypress/node_modules/rxjs/src/README.md +147 -0
  177. package/test/cypress/node_modules/safe-buffer/README.md +584 -0
  178. package/test/cypress/node_modules/safer-buffer/README.md +156 -0
  179. package/test/cypress/node_modules/semver/README.md +566 -0
  180. package/test/cypress/node_modules/shebang-command/README.md +34 -0
  181. package/test/cypress/node_modules/shebang-regex/README.md +33 -0
  182. package/test/cypress/node_modules/signal-exit/README.md +39 -0
  183. package/test/cypress/node_modules/slice-ansi/README.md +72 -0
  184. package/test/cypress/node_modules/sshpk/README.md +804 -0
  185. package/test/cypress/node_modules/string-width/README.md +50 -0
  186. package/test/cypress/node_modules/strip-ansi/README.md +46 -0
  187. package/test/cypress/node_modules/strip-final-newline/README.md +30 -0
  188. package/test/cypress/node_modules/supports-color/README.md +77 -0
  189. package/test/cypress/node_modules/throttleit/README.md +32 -0
  190. package/test/cypress/node_modules/tmp/README.md +365 -0
  191. package/test/cypress/node_modules/tough-cookie/README.md +527 -0
  192. package/test/cypress/node_modules/tslib/README.md +142 -0
  193. package/test/cypress/node_modules/tunnel-agent/README.md +4 -0
  194. package/test/cypress/node_modules/tweetnacl/README.md +459 -0
  195. package/test/cypress/node_modules/type-fest/README.md +760 -0
  196. package/test/cypress/node_modules/universalify/README.md +76 -0
  197. package/test/cypress/node_modules/untildify/README.md +30 -0
  198. package/test/cypress/node_modules/uuid/README.md +505 -0
  199. package/test/cypress/node_modules/verror/README.md +528 -0
  200. package/test/cypress/node_modules/verror/node_modules/extsprintf/README.md +46 -0
  201. package/test/cypress/node_modules/which/README.md +54 -0
  202. package/test/cypress/node_modules/wrap-ansi/README.md +91 -0
  203. package/test/cypress/node_modules/wrappy/README.md +36 -0
  204. package/test/cypress/node_modules/yallist/README.md +204 -0
  205. package/test/cypress/node_modules/yauzl/README.md +658 -0
@@ -0,0 +1,459 @@
1
+ TweetNaCl.js
2
+ ============
3
+
4
+ Port of [TweetNaCl](http://tweetnacl.cr.yp.to) / [NaCl](http://nacl.cr.yp.to/)
5
+ to JavaScript for modern browsers and Node.js. Public domain.
6
+
7
+ [![Build Status](https://travis-ci.org/dchest/tweetnacl-js.svg?branch=master)
8
+ ](https://travis-ci.org/dchest/tweetnacl-js)
9
+
10
+ Demo: <https://tweetnacl.js.org>
11
+
12
+ **:warning: The library is stable and API is frozen, however it has not been
13
+ independently reviewed. If you can help reviewing it, please [contact
14
+ me](mailto:dmitry@codingrobots.com).**
15
+
16
+ Documentation
17
+ =============
18
+
19
+ * [Overview](#overview)
20
+ * [Installation](#installation)
21
+ * [Usage](#usage)
22
+ * [Public-key authenticated encryption (box)](#public-key-authenticated-encryption-box)
23
+ * [Secret-key authenticated encryption (secretbox)](#secret-key-authenticated-encryption-secretbox)
24
+ * [Scalar multiplication](#scalar-multiplication)
25
+ * [Signatures](#signatures)
26
+ * [Hashing](#hashing)
27
+ * [Random bytes generation](#random-bytes-generation)
28
+ * [Constant-time comparison](#constant-time-comparison)
29
+ * [System requirements](#system-requirements)
30
+ * [Development and testing](#development-and-testing)
31
+ * [Benchmarks](#benchmarks)
32
+ * [Contributors](#contributors)
33
+ * [Who uses it](#who-uses-it)
34
+
35
+
36
+ Overview
37
+ --------
38
+
39
+ The primary goal of this project is to produce a translation of TweetNaCl to
40
+ JavaScript which is as close as possible to the original C implementation, plus
41
+ a thin layer of idiomatic high-level API on top of it.
42
+
43
+ There are two versions, you can use either of them:
44
+
45
+ * `nacl.js` is the port of TweetNaCl with minimum differences from the
46
+ original + high-level API.
47
+
48
+ * `nacl-fast.js` is like `nacl.js`, but with some functions replaced with
49
+ faster versions.
50
+
51
+
52
+ Installation
53
+ ------------
54
+
55
+ You can install TweetNaCl.js via a package manager:
56
+
57
+ [Bower](http://bower.io):
58
+
59
+ $ bower install tweetnacl
60
+
61
+ [NPM](https://www.npmjs.org/):
62
+
63
+ $ npm install tweetnacl
64
+
65
+ or [download source code](https://github.com/dchest/tweetnacl-js/releases).
66
+
67
+
68
+ Usage
69
+ -----
70
+
71
+ All API functions accept and return bytes as `Uint8Array`s. If you need to
72
+ encode or decode strings, use functions from
73
+ <https://github.com/dchest/tweetnacl-util-js> or one of the more robust codec
74
+ packages.
75
+
76
+ In Node.js v4 and later `Buffer` objects are backed by `Uint8Array`s, so you
77
+ can freely pass them to TweetNaCl.js functions as arguments. The returned
78
+ objects are still `Uint8Array`s, so if you need `Buffer`s, you'll have to
79
+ convert them manually; make sure to convert using copying: `new Buffer(array)`,
80
+ instead of sharing: `new Buffer(array.buffer)`, because some functions return
81
+ subarrays of their buffers.
82
+
83
+
84
+ ### Public-key authenticated encryption (box)
85
+
86
+ Implements *curve25519-xsalsa20-poly1305*.
87
+
88
+ #### nacl.box.keyPair()
89
+
90
+ Generates a new random key pair for box and returns it as an object with
91
+ `publicKey` and `secretKey` members:
92
+
93
+ {
94
+ publicKey: ..., // Uint8Array with 32-byte public key
95
+ secretKey: ... // Uint8Array with 32-byte secret key
96
+ }
97
+
98
+
99
+ #### nacl.box.keyPair.fromSecretKey(secretKey)
100
+
101
+ Returns a key pair for box with public key corresponding to the given secret
102
+ key.
103
+
104
+ #### nacl.box(message, nonce, theirPublicKey, mySecretKey)
105
+
106
+ Encrypt and authenticates message using peer's public key, our secret key, and
107
+ the given nonce, which must be unique for each distinct message for a key pair.
108
+
109
+ Returns an encrypted and authenticated message, which is
110
+ `nacl.box.overheadLength` longer than the original message.
111
+
112
+ #### nacl.box.open(box, nonce, theirPublicKey, mySecretKey)
113
+
114
+ Authenticates and decrypts the given box with peer's public key, our secret
115
+ key, and the given nonce.
116
+
117
+ Returns the original message, or `false` if authentication fails.
118
+
119
+ #### nacl.box.before(theirPublicKey, mySecretKey)
120
+
121
+ Returns a precomputed shared key which can be used in `nacl.box.after` and
122
+ `nacl.box.open.after`.
123
+
124
+ #### nacl.box.after(message, nonce, sharedKey)
125
+
126
+ Same as `nacl.box`, but uses a shared key precomputed with `nacl.box.before`.
127
+
128
+ #### nacl.box.open.after(box, nonce, sharedKey)
129
+
130
+ Same as `nacl.box.open`, but uses a shared key precomputed with `nacl.box.before`.
131
+
132
+ #### nacl.box.publicKeyLength = 32
133
+
134
+ Length of public key in bytes.
135
+
136
+ #### nacl.box.secretKeyLength = 32
137
+
138
+ Length of secret key in bytes.
139
+
140
+ #### nacl.box.sharedKeyLength = 32
141
+
142
+ Length of precomputed shared key in bytes.
143
+
144
+ #### nacl.box.nonceLength = 24
145
+
146
+ Length of nonce in bytes.
147
+
148
+ #### nacl.box.overheadLength = 16
149
+
150
+ Length of overhead added to box compared to original message.
151
+
152
+
153
+ ### Secret-key authenticated encryption (secretbox)
154
+
155
+ Implements *xsalsa20-poly1305*.
156
+
157
+ #### nacl.secretbox(message, nonce, key)
158
+
159
+ Encrypt and authenticates message using the key and the nonce. The nonce must
160
+ be unique for each distinct message for this key.
161
+
162
+ Returns an encrypted and authenticated message, which is
163
+ `nacl.secretbox.overheadLength` longer than the original message.
164
+
165
+ #### nacl.secretbox.open(box, nonce, key)
166
+
167
+ Authenticates and decrypts the given secret box using the key and the nonce.
168
+
169
+ Returns the original message, or `false` if authentication fails.
170
+
171
+ #### nacl.secretbox.keyLength = 32
172
+
173
+ Length of key in bytes.
174
+
175
+ #### nacl.secretbox.nonceLength = 24
176
+
177
+ Length of nonce in bytes.
178
+
179
+ #### nacl.secretbox.overheadLength = 16
180
+
181
+ Length of overhead added to secret box compared to original message.
182
+
183
+
184
+ ### Scalar multiplication
185
+
186
+ Implements *curve25519*.
187
+
188
+ #### nacl.scalarMult(n, p)
189
+
190
+ Multiplies an integer `n` by a group element `p` and returns the resulting
191
+ group element.
192
+
193
+ #### nacl.scalarMult.base(n)
194
+
195
+ Multiplies an integer `n` by a standard group element and returns the resulting
196
+ group element.
197
+
198
+ #### nacl.scalarMult.scalarLength = 32
199
+
200
+ Length of scalar in bytes.
201
+
202
+ #### nacl.scalarMult.groupElementLength = 32
203
+
204
+ Length of group element in bytes.
205
+
206
+
207
+ ### Signatures
208
+
209
+ Implements [ed25519](http://ed25519.cr.yp.to).
210
+
211
+ #### nacl.sign.keyPair()
212
+
213
+ Generates new random key pair for signing and returns it as an object with
214
+ `publicKey` and `secretKey` members:
215
+
216
+ {
217
+ publicKey: ..., // Uint8Array with 32-byte public key
218
+ secretKey: ... // Uint8Array with 64-byte secret key
219
+ }
220
+
221
+ #### nacl.sign.keyPair.fromSecretKey(secretKey)
222
+
223
+ Returns a signing key pair with public key corresponding to the given
224
+ 64-byte secret key. The secret key must have been generated by
225
+ `nacl.sign.keyPair` or `nacl.sign.keyPair.fromSeed`.
226
+
227
+ #### nacl.sign.keyPair.fromSeed(seed)
228
+
229
+ Returns a new signing key pair generated deterministically from a 32-byte seed.
230
+ The seed must contain enough entropy to be secure. This method is not
231
+ recommended for general use: instead, use `nacl.sign.keyPair` to generate a new
232
+ key pair from a random seed.
233
+
234
+ #### nacl.sign(message, secretKey)
235
+
236
+ Signs the message using the secret key and returns a signed message.
237
+
238
+ #### nacl.sign.open(signedMessage, publicKey)
239
+
240
+ Verifies the signed message and returns the message without signature.
241
+
242
+ Returns `null` if verification failed.
243
+
244
+ #### nacl.sign.detached(message, secretKey)
245
+
246
+ Signs the message using the secret key and returns a signature.
247
+
248
+ #### nacl.sign.detached.verify(message, signature, publicKey)
249
+
250
+ Verifies the signature for the message and returns `true` if verification
251
+ succeeded or `false` if it failed.
252
+
253
+ #### nacl.sign.publicKeyLength = 32
254
+
255
+ Length of signing public key in bytes.
256
+
257
+ #### nacl.sign.secretKeyLength = 64
258
+
259
+ Length of signing secret key in bytes.
260
+
261
+ #### nacl.sign.seedLength = 32
262
+
263
+ Length of seed for `nacl.sign.keyPair.fromSeed` in bytes.
264
+
265
+ #### nacl.sign.signatureLength = 64
266
+
267
+ Length of signature in bytes.
268
+
269
+
270
+ ### Hashing
271
+
272
+ Implements *SHA-512*.
273
+
274
+ #### nacl.hash(message)
275
+
276
+ Returns SHA-512 hash of the message.
277
+
278
+ #### nacl.hash.hashLength = 64
279
+
280
+ Length of hash in bytes.
281
+
282
+
283
+ ### Random bytes generation
284
+
285
+ #### nacl.randomBytes(length)
286
+
287
+ Returns a `Uint8Array` of the given length containing random bytes of
288
+ cryptographic quality.
289
+
290
+ **Implementation note**
291
+
292
+ TweetNaCl.js uses the following methods to generate random bytes,
293
+ depending on the platform it runs on:
294
+
295
+ * `window.crypto.getRandomValues` (WebCrypto standard)
296
+ * `window.msCrypto.getRandomValues` (Internet Explorer 11)
297
+ * `crypto.randomBytes` (Node.js)
298
+
299
+ If the platform doesn't provide a suitable PRNG, the following functions,
300
+ which require random numbers, will throw exception:
301
+
302
+ * `nacl.randomBytes`
303
+ * `nacl.box.keyPair`
304
+ * `nacl.sign.keyPair`
305
+
306
+ Other functions are deterministic and will continue working.
307
+
308
+ If a platform you are targeting doesn't implement secure random number
309
+ generator, but you somehow have a cryptographically-strong source of entropy
310
+ (not `Math.random`!), and you know what you are doing, you can plug it into
311
+ TweetNaCl.js like this:
312
+
313
+ nacl.setPRNG(function(x, n) {
314
+ // ... copy n random bytes into x ...
315
+ });
316
+
317
+ Note that `nacl.setPRNG` *completely replaces* internal random byte generator
318
+ with the one provided.
319
+
320
+
321
+ ### Constant-time comparison
322
+
323
+ #### nacl.verify(x, y)
324
+
325
+ Compares `x` and `y` in constant time and returns `true` if their lengths are
326
+ non-zero and equal, and their contents are equal.
327
+
328
+ Returns `false` if either of the arguments has zero length, or arguments have
329
+ different lengths, or their contents differ.
330
+
331
+
332
+ System requirements
333
+ -------------------
334
+
335
+ TweetNaCl.js supports modern browsers that have a cryptographically secure
336
+ pseudorandom number generator and typed arrays, including the latest versions
337
+ of:
338
+
339
+ * Chrome
340
+ * Firefox
341
+ * Safari (Mac, iOS)
342
+ * Internet Explorer 11
343
+
344
+ Other systems:
345
+
346
+ * Node.js
347
+
348
+
349
+ Development and testing
350
+ ------------------------
351
+
352
+ Install NPM modules needed for development:
353
+
354
+ $ npm install
355
+
356
+ To build minified versions:
357
+
358
+ $ npm run build
359
+
360
+ Tests use minified version, so make sure to rebuild it every time you change
361
+ `nacl.js` or `nacl-fast.js`.
362
+
363
+ ### Testing
364
+
365
+ To run tests in Node.js:
366
+
367
+ $ npm run test-node
368
+
369
+ By default all tests described here work on `nacl.min.js`. To test other
370
+ versions, set environment variable `NACL_SRC` to the file name you want to test.
371
+ For example, the following command will test fast minified version:
372
+
373
+ $ NACL_SRC=nacl-fast.min.js npm run test-node
374
+
375
+ To run full suite of tests in Node.js, including comparing outputs of
376
+ JavaScript port to outputs of the original C version:
377
+
378
+ $ npm run test-node-all
379
+
380
+ To prepare tests for browsers:
381
+
382
+ $ npm run build-test-browser
383
+
384
+ and then open `test/browser/test.html` (or `test/browser/test-fast.html`) to
385
+ run them.
386
+
387
+ To run headless browser tests with `tape-run` (powered by Electron):
388
+
389
+ $ npm run test-browser
390
+
391
+ (If you get `Error: spawn ENOENT`, install *xvfb*: `sudo apt-get install xvfb`.)
392
+
393
+ To run tests in both Node and Electron:
394
+
395
+ $ npm test
396
+
397
+ ### Benchmarking
398
+
399
+ To run benchmarks in Node.js:
400
+
401
+ $ npm run bench
402
+ $ NACL_SRC=nacl-fast.min.js npm run bench
403
+
404
+ To run benchmarks in a browser, open `test/benchmark/bench.html` (or
405
+ `test/benchmark/bench-fast.html`).
406
+
407
+
408
+ Benchmarks
409
+ ----------
410
+
411
+ For reference, here are benchmarks from MacBook Pro (Retina, 13-inch, Mid 2014)
412
+ laptop with 2.6 GHz Intel Core i5 CPU (Intel) in Chrome 53/OS X and Xiaomi Redmi
413
+ Note 3 smartphone with 1.8 GHz Qualcomm Snapdragon 650 64-bit CPU (ARM) in
414
+ Chrome 52/Android:
415
+
416
+ | | nacl.js Intel | nacl-fast.js Intel | nacl.js ARM | nacl-fast.js ARM |
417
+ | ------------- |:-------------:|:-------------------:|:-------------:|:-----------------:|
418
+ | salsa20 | 1.3 MB/s | 128 MB/s | 0.4 MB/s | 43 MB/s |
419
+ | poly1305 | 13 MB/s | 171 MB/s | 4 MB/s | 52 MB/s |
420
+ | hash | 4 MB/s | 34 MB/s | 0.9 MB/s | 12 MB/s |
421
+ | secretbox 1K | 1113 op/s | 57583 op/s | 334 op/s | 14227 op/s |
422
+ | box 1K | 145 op/s | 718 op/s | 37 op/s | 368 op/s |
423
+ | scalarMult | 171 op/s | 733 op/s | 56 op/s | 380 op/s |
424
+ | sign | 77 op/s | 200 op/s | 20 op/s | 61 op/s |
425
+ | sign.open | 39 op/s | 102 op/s | 11 op/s | 31 op/s |
426
+
427
+ (You can run benchmarks on your devices by clicking on the links at the bottom
428
+ of the [home page](https://tweetnacl.js.org)).
429
+
430
+ In short, with *nacl-fast.js* and 1024-byte messages you can expect to encrypt and
431
+ authenticate more than 57000 messages per second on a typical laptop or more than
432
+ 14000 messages per second on a $170 smartphone, sign about 200 and verify 100
433
+ messages per second on a laptop or 60 and 30 messages per second on a smartphone,
434
+ per CPU core (with Web Workers you can do these operations in parallel),
435
+ which is good enough for most applications.
436
+
437
+
438
+ Contributors
439
+ ------------
440
+
441
+ See AUTHORS.md file.
442
+
443
+
444
+ Third-party libraries based on TweetNaCl.js
445
+ -------------------------------------------
446
+
447
+ * [forward-secrecy](https://github.com/alax/forward-secrecy) — Axolotl ratchet implementation
448
+ * [nacl-stream](https://github.com/dchest/nacl-stream-js) - streaming encryption
449
+ * [tweetnacl-auth-js](https://github.com/dchest/tweetnacl-auth-js) — implementation of [`crypto_auth`](http://nacl.cr.yp.to/auth.html)
450
+ * [chloride](https://github.com/dominictarr/chloride) - unified API for various NaCl modules
451
+
452
+
453
+ Who uses it
454
+ -----------
455
+
456
+ Some notable users of TweetNaCl.js:
457
+
458
+ * [miniLock](http://minilock.io/)
459
+ * [Stellar](https://www.stellar.org/)