How to use the js-sha3.sha3_256 function in js-sha3

To help you get started, we’ve selected a few js-sha3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github airgap-it / airgap-vault / src / app / components / verify-key / verify-key.component.ts View on Github external
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)
  }
github OriginTrail / ot-node / modules / ImportUtilities.js View on Github external
static importHash(dataSetId, vertices, edges) {
        const normalized = ImportUtilities.normalizeImport(dataSetId, vertices, edges);
        return Utilities.normalizeHex(sha3_256(Utilities.stringify(normalized, 0)));
    }
github oysterprotocol / webnode / webnode / src / utils / encryption.js View on Github external
const sideChain = address => sha3_256(address).toString();
github uport-project / uport-mobile / lib / screens / Credential.js View on Github external
deleteVerification() {
    const tokenHash = sha3_256(this.props.verification.token)
    this.props.removeAttestation(this.props.address, tokenHash)
    this.props.navigator.pop()
  }
  expirationItem(exp) {
github airgap-it / airgap-vault / src / components / verify-key / verify-key.ts View on Github external
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)
  }
github uport-project / uport-mobile / lib / components / Request / types / VerificationCard.js View on Github external
cancelRequest: activity => {
    dispatch(cancelRequest(activity.id))
    const attestation = activity.attestations && activity.attestations[0]
    if (attestation) {
      dispatch(removeAttestation(attestation.sub, sha3_256(attestation.token)))
    }
  },
})
github 44uk / nem2-dev-ui / src / util / convert.ts View on Github external
export const hashBySha3 = (input: string) => {
  return sha3_256(input)
}
github airgap-it / airgap-vault / src / app / components / verify-key / verify-key.component.ts View on Github external
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)
  }
github hyperledger / iroha-javascript / src / irohajs.ts View on Github external
sign (msg: string): string {
    const message = new Buffer(sha3_256(msg));
    return supercop.sign(message, this.publicKey, this.privateKey).toString("base64");
  }
}
github embark-framework / embark / old_lib / chain_manager.js View on Github external
ChainManager.prototype.getContract = function(contractName, code, args) {
  return this.currentChain.contracts[sha3_256(code + contractName + args.join(','))];
}