Files
common/src/keccak/asString.js
T
Jaco Greeff 1216968145 Use @polkadot/dev for common tasks (#8)
* Link to docs in README

* Use @polkadot/dev for common tasks

* 0.5.0 since docs added
2017-11-20 23:04:33 +01:00

20 lines
619 B
JavaScript

// ISC, Copyright 2017 Jaco Greeff
// @flow
const keccakAsBuffer = require('./asBuffer');
/**
@name keccakAsString
@signature keccakAsString (value: Buffer | string): string
@summary Creates a keccak string from the input.
@description
From either a `string` or a `Buffer` input, create the keccak and return the result as a non-prefixed string.
@example
import { keccakAsString } from '@polkadot/util';
console.log('asString', keccakAsString('123')) // => string
*/
module.exports = function keccakAsString (value: Buffer | string): string {
return keccakAsBuffer(value).toString('hex');
};