How to use the js-sha3.sha3_384 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 hyperledger-archives / fabric / sdk / node / kdf.js View on Github external
hash_sha3_384.hash = function (data) {
    var hashBits = sjcl.codec.hex.toBits(sha3_384(data));

    return hashBits;
};
github ontio / ontology-ts-sdk / src / crypto / Key.ts View on Github external
switch (scheme) {
        case SignatureScheme.ECDSAwithSHA224:
            return cryptoJS.SHA224(cryptoJS.enc.Hex.parse(msg)).toString();
        case SignatureScheme.ECDSAwithSHA256:
            return cryptoJS.SHA256(cryptoJS.enc.Hex.parse(msg)).toString();
        case SignatureScheme.ECDSAwithSHA384:
            return cryptoJS.SHA384(cryptoJS.enc.Hex.parse(msg)).toString();
        case SignatureScheme.ECDSAwithSHA512:
        case SignatureScheme.EDDSAwithSHA512:
            return cryptoJS.SHA512(cryptoJS.enc.Hex.parse(msg)).toString();
        case SignatureScheme.ECDSAwithSHA3_224:
            return sha3_224(hexstring2ab(msg));
        case SignatureScheme.ECDSAwithSHA3_256:
            return sha3_256(hexstring2ab(msg));
        case SignatureScheme.ECDSAwithSHA3_384:
            return sha3_384(hexstring2ab(msg));
        case SignatureScheme.ECDSAwithSHA3_512:
            return sha3_512(hexstring2ab(msg));
        case SignatureScheme.ECDSAwithRIPEMD160:
            return cryptoJS.RIPEMD160(cryptoJS.enc.Hex.parse(msg)).toString();
        case SignatureScheme.SM2withSM3:
            return (new sm3()).sum(hexstring2ab(msg), 'hex');
        default:
            throw new Error('Unsupported hash algorithm.');
        }
    }
github hyperledger / fabric / sdk / node / lib / hash.js View on Github external
hash_sha3_384.hash = function (data) {
    var hashBits = sjcl.codec.hex.toBits(sha3_384(bitsToBytes(data)));
    return hashBits;
};