Files
common/packages/util-crypto/src/address/sshash.ts
T
Jaco Greeff 6907add8ff Move address helpers to util-crypto (#416)
* Move address helpers to util

* Move address helpers to @polkadot/util-crypto
2019-06-12 15:01:54 +02:00

14 lines
464 B
TypeScript

// Copyright 2017-2019 @polkadot/util-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { stringToU8a, u8aConcat } from '@polkadot/util';
import blake2AsU8a from '../blake2/asU8a';
const SS58_PREFIX = stringToU8a('SS58PRE');
export default function hash (key: Uint8Array): Uint8Array {
return blake2AsU8a(u8aConcat(SS58_PREFIX, key), 512);
}