How to use keccak - 2 common examples

To help you get started, we’ve selected a few keccak 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 elevenyellow / coinfy / src / api / coins / ETH.js View on Github external
function toChecksumAddress(address) {
    address = address.toLowerCase().replace('0x', '')
    let hash = createKeccakHash('keccak256')
        .update(address)
        .digest('hex')
    let ret = '0x'

    for (let i = 0; i < address.length; i++) {
        if (parseInt(hash[i], 16) >= 8) {
            ret += address[i].toUpperCase()
        } else {
            ret += address[i]
        }
    }

    return ret
}
github urbit / bridge / src / lib / wallet.js View on Github external
export const keccak256 = str =>
  keccak('keccak256')
    .update(str)
    .digest();

keccak

Keccak sponge function family

MIT
Latest version published 1 year ago

Package Health Score

68 / 100
Full package analysis

Popular keccak functions