f33 server
sudo dnf updatesudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo| import React, { useRef, useState } from "react" | |
| import styled from "styled-components" | |
| import useScanner from "./useScanner" | |
| import type { QuaggaJSResultObject } from "@ericblade/quagga2" | |
| interface ScannerProps extends React.HTMLAttributes<HTMLDivElement> { | |
| active: boolean | |
| onResults: any | |
| } |
| // Copyright (c) 2020 Chris Gutwin. All rights reserved. | |
| // This work is licensed under the terms of the MIT license. | |
| // For a copy, see <https://choosealicense.com/licenses/mit/>. | |
| // | |
| // An implementation of the Quagga 1 QR scanner as a React component. | |
| // Mitigates false positives by quickly taking multiple scans, and using the most detected of n = 40 scans. | |
| // This isn't really needed anymore from my limited testing, Quagga 2 (@ericblade/quagga2) seems to have fewer false positives. | |
| // Feel free to abstract away the non-React functions. They clutter up the component and make it feel non-component like. | |
| import Quagga from 'quagga' | |
| import React, { useEffect, useState } from 'react' |
| /* | |
| * Will accept an object, and add a carriage return to the end of each entry | |
| * to format for console readability. | |
| * */ | |
| const formatObject = (obj) => { | |
| let formattedObject = `` | |
| /* | |
| Some items might come in empty (such as params, query, body), so if it's | |
| empty, just skip over it. |
| /* | |
| * Encryption for the added user accounts and passwords | |
| * | |
| * Reference: | |
| * https://stackoverflow.com/a/5093422 | |
| * */ | |
| require('dotenv').config() | |
| const CRYPTO = require('crypto') | |
| const Encryption = require('./Encryption') |