rats-search/bt/token.js
2017-02-03 12:29:51 +03:00

16 lines
294 B
JavaScript

'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)])
}
}