UNPKG

569 BJavaScriptView Raw
1// Copyright 2017-2022 @polkadot/util-crypto authors & contributors
2// SPDX-License-Identifier: Apache-2.0
3import { bnToU8a, compactToU8a, stringToU8a, u8aConcat, u8aSorted } from '@polkadot/util';
4import { blake2AsU8a } from "../blake2/asU8a.js";
5import { BN_LE_16_OPTS } from "../bn.js";
6import { addressToU8a } from "./util.js";
7const PREFIX = stringToU8a('modlpy/utilisuba');
8export function createKeyMulti(who, threshold) {
9 return blake2AsU8a(u8aConcat(PREFIX, compactToU8a(who.length), ...u8aSorted(who.map(addressToU8a)), bnToU8a(threshold, BN_LE_16_OPTS)));
10}
\No newline at end of file