// 微信小程序 atob polyfill(bwip-js 字体解码依赖) // 此文件作为副作用导入,必须在 bwip-js 之前加载 var _chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' function _atob(input) { var str = String(input).replace(/[=]+$/, '') var output = '' var bc = 0, bs, buffer = 0, i = 0 for (; str.charAt(i | 0); i++) { bs = _chars.indexOf(str.charAt(i)) buffer = (buffer << 6) | bs bc += 6 if (bc >= 8) { bc -= 8 output += String.fromCharCode((buffer >>> bc) & 255) } } return output } // 同时设置 globalThis 和 global(兼容不同微信基础库版本) try { globalThis.atob = globalThis.atob || _atob } catch (e) {} try { global.atob = global.atob || _atob } catch (e) {}