Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.promptedWords = []
const correctWord: SingleWord = this.splittedSecret[this.emptySpot(this.currentWords)]
this.promptedWords.push(correctWord)
const wordList: string[] = bip39.wordlists.EN
for (let i: number = 0; i < ADDITIONAL_WORDS; i++) {
const filteredList: string[] = wordList.filter(
(originalWord: string) => !this.splittedSecret.find((word: SingleWord) => word === originalWord)
)
let hashedWord: string = sha3_256(correctWord)
for (let hashRuns: number = 0; hashRuns <= i; hashRuns++) {
hashedWord = sha3_256(hashedWord)
}
const additionalWord: SingleWord = filteredList[this.stringToIntHash(hashedWord, 0, filteredList.length)]
this.promptedWords.push(additionalWord)
}
this.promptedWords = this.shuffle(this.promptedWords)
}
static importHash(dataSetId, vertices, edges) {
const normalized = ImportUtilities.normalizeImport(dataSetId, vertices, edges);
return Utilities.normalizeHex(sha3_256(Utilities.stringify(normalized, 0)));
}
const sideChain = address => sha3_256(address).toString();
deleteVerification() {
const tokenHash = sha3_256(this.props.verification.token)
this.props.removeAttestation(this.props.address, tokenHash)
this.props.navigator.pop()
}
expirationItem(exp) {
promptNextWord() {
this.promptedWords.length = 0
const correctWord = this.splittedSecret[this.emptySpot(this.currentWords)]
this.promptedWords.push(correctWord)
const wordList = bip39.wordlists.EN.slice()
for (let i = 0; i < ADDITIONAL_WORDS; i++) {
const filteredList = wordList.filter(word => !this.splittedSecret.find(w => w.word === word))
let hashedWord = sha3_256(correctWord.word)
for (let hashRuns = 0; hashRuns <= i; hashRuns++) {
hashedWord = sha3_256(hashedWord)
}
const word: Word = {
word: filteredList[this.stringToIntHash(hashedWord, 0, filteredList.length)]
}
this.promptedWords.push(word)
}
this.promptedWords = this.shuffle(this.promptedWords)
}
cancelRequest: activity => {
dispatch(cancelRequest(activity.id))
const attestation = activity.attestations && activity.attestations[0]
if (attestation) {
dispatch(removeAttestation(attestation.sub, sha3_256(attestation.token)))
}
},
})
export const hashBySha3 = (input: string) => {
return sha3_256(input)
}
public promptNextWord(): void {
this.promptedWords = []
const correctWord: SingleWord = this.splittedSecret[this.emptySpot(this.currentWords)]
this.promptedWords.push(correctWord)
const wordList: string[] = bip39.wordlists.EN
for (let i: number = 0; i < ADDITIONAL_WORDS; i++) {
const filteredList: string[] = wordList.filter(
(originalWord: string) => !this.splittedSecret.find((word: SingleWord) => word === originalWord)
)
let hashedWord: string = sha3_256(correctWord)
for (let hashRuns: number = 0; hashRuns <= i; hashRuns++) {
hashedWord = sha3_256(hashedWord)
}
const additionalWord: SingleWord = filteredList[this.stringToIntHash(hashedWord, 0, filteredList.length)]
this.promptedWords.push(additionalWord)
}
this.promptedWords = this.shuffle(this.promptedWords)
}
sign (msg: string): string {
const message = new Buffer(sha3_256(msg));
return supercop.sign(message, this.publicKey, this.privateKey).toString("base64");
}
}
ChainManager.prototype.getContract = function(contractName, code, args) {
return this.currentChain.contracts[sha3_256(code + contractName + args.join(','))];
}