UNPKG

@ethersphere/bee-js

Version:
11 lines (10 loc) 564 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.makeFeedIdentifier = void 0; const cafe_utility_1 = require("cafe-utility"); const typed_bytes_1 = require("../utils/typed-bytes"); function makeFeedIdentifier(topic, index) { index = typeof index === 'number' ? typed_bytes_1.FeedIndex.fromBigInt(BigInt(index)) : index; return new typed_bytes_1.Identifier(cafe_utility_1.Binary.keccak256(cafe_utility_1.Binary.concatBytes(topic.toUint8Array(), index.toUint8Array()))); } exports.makeFeedIdentifier = makeFeedIdentifier;