mirror of https://github.com/requarks/wiki
parent
007ad30cc6
commit
5223368e37
File diff suppressed because one or more lines are too long
@ -1,26 +0,0 @@
|
||||
'use strict'
|
||||
|
||||
const crypto = require('crypto')
|
||||
|
||||
/**
|
||||
* Internal Authentication
|
||||
*/
|
||||
module.exports = {
|
||||
|
||||
_curKey: false,
|
||||
|
||||
init (inKey) {
|
||||
this._curKey = inKey
|
||||
|
||||
return this
|
||||
},
|
||||
|
||||
generateKey () {
|
||||
return crypto.randomBytes(20).toString('hex')
|
||||
},
|
||||
|
||||
validateKey (inKey) {
|
||||
return inKey === this._curKey
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue