продолжаем вносить все
This commit is contained in:
16
lib/token.js
Normal file
16
lib/token.js
Normal file
@ -0,0 +1,16 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = class {
|
||||
constructor() {
|
||||
this.generate()
|
||||
setInterval(()=> this.generate(), 60000*15)
|
||||
}
|
||||
|
||||
isValid(t) {
|
||||
return t.toString() === this.token.toString()
|
||||
}
|
||||
|
||||
generate() {
|
||||
this.token = new Buffer([parseInt(Math.random()*200), parseInt(Math.random()*200)])
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user