bililive-cli 1.5.0 → 1.6.0

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.
@@ -1,67 +0,0 @@
1
- 'use strict';
2
-
3
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
4
- // require the crypto API and do not support built-in fallback to lower quality random number
5
- // generators (like Math.random()).
6
- var getRandomValues;
7
- var rnds8 = new Uint8Array(16);
8
- function rng() {
9
- // lazy load so that environments that need to polyfill have a chance to do so
10
- if (!getRandomValues) {
11
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
12
- // find the complete implementation of crypto (msCrypto) on IE11.
13
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
14
-
15
- if (!getRandomValues) {
16
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
17
- }
18
- }
19
-
20
- return getRandomValues(rnds8);
21
- }
22
-
23
- var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
24
-
25
- function validate(uuid) {
26
- return typeof uuid === 'string' && REGEX.test(uuid);
27
- }
28
-
29
- /**
30
- * Convert array of 16 byte values to UUID string format of the form:
31
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
32
- */
33
-
34
- var byteToHex = [];
35
-
36
- for (var i = 0; i < 256; ++i) {
37
- byteToHex.push((i + 0x100).toString(16).substr(1));
38
- }
39
-
40
- function stringify(arr) {
41
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
42
- // Note: Be careful editing this code! It's been tuned for performance
43
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
44
- var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
45
- // of the following:
46
- // - One or more input array values don't map to a hex octet (leading to
47
- // "undefined" in the uuid)
48
- // - Invalid input values for the RFC `version` or `variant` fields
49
-
50
- if (!validate(uuid)) {
51
- throw TypeError('Stringified UUID is invalid');
52
- }
53
-
54
- return uuid;
55
- }
56
-
57
- function v4(options, buf, offset) {
58
- options = options || {};
59
- var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
60
-
61
- rnds[6] = rnds[6] & 0x0f | 0x40;
62
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
63
-
64
- return stringify(rnds);
65
- }
66
-
67
- exports.v4 = v4;