UNPKG

524 BJavaScriptView Raw
1'use strict';
2
3// Copyright 2017-2018 Jaco Greeff
4// This software may be modified and distributed under the terms
5// of the ISC license. See the LICENSE file for details.
6var u8aConcat = require('@polkadot/util/u8a/concat');
7var u8aFromString = require('@polkadot/util/u8a/fromString');
8var u8aToHex = require('@polkadot/util/u8a/toHex');
9var xxhash = require('@polkadot/util-crypto/xxhash/asU8a128');
10
11module.exports = function storageKey(prefix, key) {
12 return u8aToHex(xxhash(u8aConcat(u8aFromString(prefix), key)));
13};
\No newline at end of file