RuiSiang / PoW-Shield

Class methods should utilize this JS-0105
Anti-pattern
Minor
8 months ago8 months old
Expected 'this' to be used by class method 'genNonce'
17      }
18    }
19  }
20  private genNonce = (buf: Buffer) => {21    const now = Date.now()
22    let off = utils.writeTimestamp(buf, now, 0)
23    const words = off + (((buf.length - off) / 4) | 0) * 4
Expected 'this' to be used by class method 'getProblem'
16    return await this.verify(nonce, session.difficulty, session.prefix)
17  }
18
19  public getProblem = (): { prefix: string } => {20    return {
21      prefix: randomstring.generate({ length: 16, charset: 'hex' }),
22    }
Expected 'this' to be used by class method 'parseNumString'
 62    })
 63  }
 64
 65  private parseNumString = (numString: string) => { 66    const substrings = numString.split(',')
 67    const numArr: number[] = []
 68    substrings.forEach(function (item) {