update all libraries

This commit is contained in:
El RIDO
2022-02-18 07:36:09 +01:00
parent c8c6a67530
commit 7277d2bb43
30 changed files with 928 additions and 257 deletions

View File

@@ -1,17 +1,16 @@
'use strict';
// base-x encoding / decoding
// based on https://github.com/cryptocoinjs/base-x 3.0.7
// modification: removed Buffer dependency and node.modules entry
// Copyright (c) 2018 base-x contributors
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
// Distributed under the MIT software license, see the accompanying
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
(function(){
this.baseX = function base (ALPHABET) {
if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
var BASE_MAP = new Uint8Array(256)
BASE_MAP.fill(255)
for (var j = 0; j < BASE_MAP.length; j++) {
BASE_MAP[j] = 255
}
for (var i = 0; i < ALPHABET.length; i++) {
var x = ALPHABET.charAt(i)
var xc = x.charCodeAt(0)
@@ -23,6 +22,13 @@ this.baseX = function base (ALPHABET) {
var FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up
var iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up
function encode (source) {
if (source instanceof Uint8Array) {
} else if (ArrayBuffer.isView(source)) {
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength)
} else if (Array.isArray(source)) {
source = Uint8Array.from(source)
}
if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
if (source.length === 0) { return '' }
// Skip & count leading zeroes.
var zeroes = 0
@@ -62,10 +68,8 @@ this.baseX = function base (ALPHABET) {
}
function decodeUnsafe (source) {
if (typeof source !== 'string') { throw new TypeError('Expected String') }
if (source.length === 0) { return '' }
if (source.length === 0) { return new Uint8Array() }
var psz = 0
// Skip leading spaces.
if (source[psz] === ' ') { return }
// Skip and count leading '1's.
var zeroes = 0
var length = 0
@@ -92,14 +96,12 @@ this.baseX = function base (ALPHABET) {
length = i
psz++
}
// Skip trailing spaces.
if (source[psz] === ' ') { return }
// Skip leading zeroes in b256.
var it4 = size - length
while (it4 !== size && b256[it4] === 0) {
it4++
}
var vch = []
var vch = new Uint8Array(zeroes + (size - it4))
var j = zeroes
while (it4 !== size) {
vch[j++] = b256[it4++]

View File

@@ -16,9 +16,9 @@ global.zlib = require('./zlib-1.2.11').zlib;
require('./prettify');
global.prettyPrint = window.PR.prettyPrint;
global.prettyPrintOne = window.PR.prettyPrintOne;
global.showdown = require('./showdown-1.9.1');
global.DOMPurify = require('./purify-2.2.7');
global.baseX = require('./base-x-3.0.7').baseX;
global.showdown = require('./showdown-2.0.0');
global.DOMPurify = require('./purify-2.3.6');
global.baseX = require('./base-x-4.0.0').baseX;
global.Legacy = require('./legacy').Legacy;
require('./bootstrap-3.3.7');
require('./privatebin');

File diff suppressed because one or more lines are too long

2
js/purify-2.3.6.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
js/showdown-2.0.0.js Normal file

File diff suppressed because one or more lines are too long