UNPKG

@ethersphere/bee-js

Version:
18 lines (17 loc) 662 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.makeMaxTarget = void 0; const types_1 = require("../types"); const typed_bytes_1 = require("./typed-bytes"); /** * Utility function that for given strings/reference takes the most specific * target that Bee node will except. * * @param target is a non-prefixed hex string Bee address * @see [Bee docs - PSS](https://docs.ethswarm.org/docs/develop/tools-and-features/pss) */ function makeMaxTarget(target) { target = new typed_bytes_1.PeerAddress(target); return target.toHex().slice(0, types_1.PSS_TARGET_HEX_LENGTH_MAX); } exports.makeMaxTarget = makeMaxTarget;