init
This commit is contained in:
8
mc_test/node_modules/tweetnacl-util/AUTHORS.md
generated
vendored
Executable file
8
mc_test/node_modules/tweetnacl-util/AUTHORS.md
generated
vendored
Executable file
@ -0,0 +1,8 @@
|
||||
List of authors
|
||||
===============
|
||||
|
||||
Alphabetical order by first name.
|
||||
Format: Name (GitHub username or URL)
|
||||
|
||||
* AndSDev (@AndSDev)
|
||||
* Dmitry Chestnykh (@dchest)
|
||||
24
mc_test/node_modules/tweetnacl-util/LICENSE
generated
vendored
Executable file
24
mc_test/node_modules/tweetnacl-util/LICENSE
generated
vendored
Executable file
@ -0,0 +1,24 @@
|
||||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more information, please refer to <http://unlicense.org>
|
||||
81
mc_test/node_modules/tweetnacl-util/README.md
generated
vendored
Executable file
81
mc_test/node_modules/tweetnacl-util/README.md
generated
vendored
Executable file
@ -0,0 +1,81 @@
|
||||
tweetnacl-util-js
|
||||
=================
|
||||
|
||||
String encoding utilities extracted from early versions of <https://github.com/dchest/tweetnacl-js>
|
||||
|
||||
Notice
|
||||
------
|
||||
|
||||
Encoding/decoding functions in this package are correct,
|
||||
however their performance and wide compatibility with uncommon runtimes is not
|
||||
something that is considered important compared to the simplicity and size of
|
||||
implementation. For example, they don't work under
|
||||
React Native.
|
||||
|
||||
Instead of this package, I strongly recommend using my [StableLib](https://github.com/StableLib/stablelib) packages:
|
||||
|
||||
* [@stablelib/utf8](https://www.stablelib.com/modules/_utf8_utf8_.html) for UTF-8
|
||||
encoding/decoding (note that the names of operations are reversed compared to
|
||||
this package): `npm install @stablelib/utf8`
|
||||
|
||||
* [@stablelib/base64](https://www.stablelib.com/modules/_base64_base64_.html) for
|
||||
constant-time Base64 encoding/decoding: `npm install @stablelib/base64`
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Use a package manager:
|
||||
|
||||
[Bower](http://bower.io):
|
||||
|
||||
$ bower install tweetnacl-util
|
||||
|
||||
[NPM](https://www.npmjs.org/):
|
||||
|
||||
$ npm install tweetnacl-util
|
||||
|
||||
or [download source code](https://github.com/dchest/tweetnacl-util-js/releases).
|
||||
|
||||
|
||||
Usage
|
||||
------
|
||||
|
||||
To make keep backward compatibility with code that used `nacl.util` previously
|
||||
included with TweetNaCl.js, just include it as usual:
|
||||
|
||||
```
|
||||
<script src="nacl.min.js"></script>
|
||||
<script src="nacl-util.min.js"></script>
|
||||
<script>
|
||||
// nacl.util functions are now available, e.g.:
|
||||
// nacl.util.decodeUTF8
|
||||
</script>
|
||||
```
|
||||
|
||||
When using CommonJS:
|
||||
|
||||
```
|
||||
var nacl = require('tweetnacl');
|
||||
nacl.util = require('tweetnacl-util');
|
||||
```
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
#### nacl.util.decodeUTF8(string)
|
||||
|
||||
Decodes string and returns `Uint8Array` of bytes.
|
||||
|
||||
#### nacl.util.encodeUTF8(array)
|
||||
|
||||
Encodes `Uint8Array` or `Array` of bytes into string.
|
||||
|
||||
#### nacl.util.decodeBase64(string)
|
||||
|
||||
Decodes Base-64 encoded string and returns `Uint8Array` of bytes.
|
||||
|
||||
#### nacl.util.encodeBase64(array)
|
||||
|
||||
Encodes `Uint8Array` or `Array` of bytes into string using Base-64 encoding.
|
||||
11
mc_test/node_modules/tweetnacl-util/nacl-util.d.ts
generated
vendored
Executable file
11
mc_test/node_modules/tweetnacl-util/nacl-util.d.ts
generated
vendored
Executable file
@ -0,0 +1,11 @@
|
||||
// Type definitions for tweetnacl-util
|
||||
|
||||
declare var util: util;
|
||||
export = util;
|
||||
|
||||
interface util {
|
||||
decodeUTF8(s: string): Uint8Array;
|
||||
encodeUTF8(arr: Uint8Array): string;
|
||||
encodeBase64(arr: Uint8Array): string;
|
||||
decodeBase64(s: string): Uint8Array;
|
||||
}
|
||||
81
mc_test/node_modules/tweetnacl-util/nacl-util.js
generated
vendored
Executable file
81
mc_test/node_modules/tweetnacl-util/nacl-util.js
generated
vendored
Executable file
@ -0,0 +1,81 @@
|
||||
// Written in 2014-2016 by Dmitry Chestnykh and Devi Mandiri.
|
||||
// Public domain.
|
||||
(function(root, f) {
|
||||
'use strict';
|
||||
if (typeof module !== 'undefined' && module.exports) module.exports = f();
|
||||
else if (root.nacl) root.nacl.util = f();
|
||||
else {
|
||||
root.nacl = {};
|
||||
root.nacl.util = f();
|
||||
}
|
||||
}(this, function() {
|
||||
'use strict';
|
||||
|
||||
var util = {};
|
||||
|
||||
function validateBase64(s) {
|
||||
if (!(/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(s))) {
|
||||
throw new TypeError('invalid encoding');
|
||||
}
|
||||
}
|
||||
|
||||
util.decodeUTF8 = function(s) {
|
||||
if (typeof s !== 'string') throw new TypeError('expected string');
|
||||
var i, d = unescape(encodeURIComponent(s)), b = new Uint8Array(d.length);
|
||||
for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i);
|
||||
return b;
|
||||
};
|
||||
|
||||
util.encodeUTF8 = function(arr) {
|
||||
var i, s = [];
|
||||
for (i = 0; i < arr.length; i++) s.push(String.fromCharCode(arr[i]));
|
||||
return decodeURIComponent(escape(s.join('')));
|
||||
};
|
||||
|
||||
if (typeof atob === 'undefined') {
|
||||
// Node.js
|
||||
|
||||
if (typeof Buffer.from !== 'undefined') {
|
||||
// Node v6 and later
|
||||
util.encodeBase64 = function (arr) { // v6 and later
|
||||
return Buffer.from(arr).toString('base64');
|
||||
};
|
||||
|
||||
util.decodeBase64 = function (s) {
|
||||
validateBase64(s);
|
||||
return new Uint8Array(Array.prototype.slice.call(Buffer.from(s, 'base64'), 0));
|
||||
};
|
||||
|
||||
} else {
|
||||
// Node earlier than v6
|
||||
util.encodeBase64 = function (arr) { // v6 and later
|
||||
return (new Buffer(arr)).toString('base64');
|
||||
};
|
||||
|
||||
util.decodeBase64 = function(s) {
|
||||
validateBase64(s);
|
||||
return new Uint8Array(Array.prototype.slice.call(new Buffer(s, 'base64'), 0));
|
||||
};
|
||||
}
|
||||
|
||||
} else {
|
||||
// Browsers
|
||||
|
||||
util.encodeBase64 = function(arr) {
|
||||
var i, s = [], len = arr.length;
|
||||
for (i = 0; i < len; i++) s.push(String.fromCharCode(arr[i]));
|
||||
return btoa(s.join(''));
|
||||
};
|
||||
|
||||
util.decodeBase64 = function(s) {
|
||||
validateBase64(s);
|
||||
var i, d = atob(s), b = new Uint8Array(d.length);
|
||||
for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i);
|
||||
return b;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
return util;
|
||||
|
||||
}));
|
||||
1
mc_test/node_modules/tweetnacl-util/nacl-util.min.js
generated
vendored
Executable file
1
mc_test/node_modules/tweetnacl-util/nacl-util.min.js
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
!function(e,n){"use strict";"undefined"!=typeof module&&module.exports?module.exports=n():(e.nacl||(e.nacl={}),e.nacl.util=n())}(this,function(){"use strict";var e={};function o(e){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e))throw new TypeError("invalid encoding")}return e.decodeUTF8=function(e){if("string"!=typeof e)throw new TypeError("expected string");var n,r=unescape(encodeURIComponent(e)),t=new Uint8Array(r.length);for(n=0;n<r.length;n++)t[n]=r.charCodeAt(n);return t},e.encodeUTF8=function(e){var n,r=[];for(n=0;n<e.length;n++)r.push(String.fromCharCode(e[n]));return decodeURIComponent(escape(r.join("")))},"undefined"==typeof atob?void 0!==Buffer.from?(e.encodeBase64=function(e){return Buffer.from(e).toString("base64")},e.decodeBase64=function(e){return o(e),new Uint8Array(Array.prototype.slice.call(Buffer.from(e,"base64"),0))}):(e.encodeBase64=function(e){return new Buffer(e).toString("base64")},e.decodeBase64=function(e){return o(e),new Uint8Array(Array.prototype.slice.call(new Buffer(e,"base64"),0))}):(e.encodeBase64=function(e){var n,r=[],t=e.length;for(n=0;n<t;n++)r.push(String.fromCharCode(e[n]));return btoa(r.join(""))},e.decodeBase64=function(e){o(e);var n,r=atob(e),t=new Uint8Array(r.length);for(n=0;n<r.length;n++)t[n]=r.charCodeAt(n);return t}),e});
|
||||
36
mc_test/node_modules/tweetnacl-util/package.json
generated
vendored
Executable file
36
mc_test/node_modules/tweetnacl-util/package.json
generated
vendored
Executable file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "tweetnacl-util",
|
||||
"version": "0.15.1",
|
||||
"description": "String encoding utilitlies extracted from TweetNaCl.js",
|
||||
"main": "nacl-util.js",
|
||||
"types": "nacl-util.d.ts",
|
||||
"scripts": {
|
||||
"build": "uglifyjs nacl-util.js -c -m -o nacl-util.min.js",
|
||||
"test": "tape test/*.js; yarn run build-browser-test",
|
||||
"build-browser-test": "browserify test/test.js > test/browser/bundle.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dchest/tweetnacl-util-js.git"
|
||||
},
|
||||
"keywords": [
|
||||
"base64",
|
||||
"utf8",
|
||||
"string",
|
||||
"encoding"
|
||||
],
|
||||
"author": "TweetNaCl-js contributors",
|
||||
"license": "Unlicense",
|
||||
"bugs": {
|
||||
"url": "https://github.com/dchest/tweetnacl-util-js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/dchest/tweetnacl-util-js",
|
||||
"devDependencies": {
|
||||
"browserify": "^16.5.0",
|
||||
"tape": "^4.13.0",
|
||||
"uglify-js": "^3.7.6"
|
||||
},
|
||||
"browser": {
|
||||
"buffer": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user