UNPKG

@test-org122/hypernet-core

Version:

Hypernet Core. Represents the SDK for running the Hypernet Protocol.

16 lines 673 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ChannelUtils = void 0; const sjcl_1 = __importDefault(require("sjcl")); class ChannelUtils { static getChannelId(consumerAddress, providerAddress) { const combinedAddress = `${consumerAddress} ${providerAddress}`; const hashBits = sjcl_1.default.hash.sha256.hash(combinedAddress); return sjcl_1.default.codec.base64.fromBits(hashBits); } } exports.ChannelUtils = ChannelUtils; //# sourceMappingURL=ChannelUtils.js.map