use alphanumeric QR and elm qr module
This commit is contained in:
parent
c3cd705bc9
commit
7a2a854fce
3 changed files with 8263 additions and 4340 deletions
|
|
@ -2,10 +2,14 @@ const fs = require('fs')
|
|||
const pify = require('pify')
|
||||
const readFile = pify(fs.readFile)
|
||||
const crypto = require('crypto')
|
||||
const baseX = require('base-x')
|
||||
|
||||
const options = require('../options')
|
||||
const db = require('../db')
|
||||
|
||||
const ALPHA_BASE = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'
|
||||
const bsAlpha = baseX(ALPHA_BASE)
|
||||
|
||||
function unpair (deviceId) {
|
||||
const sql = 'update devices set paired=FALSE where device_id=$1'
|
||||
|
||||
|
|
@ -31,7 +35,7 @@ function totem (hostname, name) {
|
|||
const sql = 'insert into pairing_tokens (token, name) values ($1, $3), ($2, $3)'
|
||||
|
||||
return db.none(sql, [hexToken, caHexToken, name])
|
||||
.then(() => buf.toString('base64'))
|
||||
.then(() => bsAlpha.encode(buf))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
12588
public/elm.js
12588
public/elm.js
File diff suppressed because one or more lines are too long
|
|
@ -2,9 +2,6 @@
|
|||
<head>
|
||||
<base href="/">
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>
|
||||
<script src="bower_components/qrjs/qr.js"></script>
|
||||
<script src="bower_components/qr-code/src/qr-code.js"></script>
|
||||
<script src="elm.js"></script>
|
||||
<style>
|
||||
@keyframes fadein {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue