import { ByteString, Int32 } from '../types/primitives.js'; /** * Converts a literal to ByteString. * If not passing `isUtf8` or `isUtf8` is false, then `literal` should be in the format of hex literal, i.e. `/^([0-9a-fA-F]{2})*$/` * Otherwise, `literal` should be in the format of utf8 literal, i.e. `hello world` * @category Global Functions * @onchain * @param {string} literal literal string, can be hex literal or utf8 literal, depends on the `isUtf8` marker * @param {boolean} isUtf8 marker indicating whether `literal` is utf8 or hex * @returns {ByteString} returns a ByteString */ export declare function toByteString(literal: string, isUtf8?: boolean): ByteString; /** * int can be converted to a byte string with int2ByteString. * @param n - a number being converts * @param size - the size of the result byte string, if not specified, the size will be determined by the number of bytes required to represent the number. * @category Global Functions * @onchain * @returns {ByteString} returns a ByteString * @throws {Error} throws an error if the number is out of range `size` bytes */ export declare function intToByteString(n: bigint, size?: bigint): ByteString; /** * ByteString can be converted to bigint with byteString2Int. * @param a - a ByteString being converts * @category Global Functions * @onchain * @returns {Int32} returns a number */ export declare function byteStringToInt(a: ByteString): bigint; /** * Returns the length of the ByteString. Not the length of the string. * @category Global Functions * @onchain * @param a - a ByteString * @returns {bigint} The length of the ByteString. */ export declare function len(a: ByteString): Int32; /** * Returns a section of a ByteString. * @category Global Functions * @onchain * @param byteString The ByteString. * @param start The beginning byte index of the specified portion of ByteString, included. * @param end The end byte index of the specified portion of ByteString, excluded. * If this value is not specified, the sub-section continues to the end of ByteString. */ export declare function slice(byteString: ByteString, start: Int32, end?: Int32): ByteString; /** * Returns reversed bytes of b, which is of size bytes. Note size must be a compiled-time constant. * It is often useful when converting a number between little-endian and big-endian. * @category Global Functions * @onchain * @param b - a ByteString to be reversed * @param size - the size of the ByteString. * @returns {ByteString} reversed ByteString. */ export declare function reverseByteString(b: ByteString, size: Int32): ByteString; //# sourceMappingURL=byteString.d.ts.map