UNPKG

@tgsnake/fileid

Version:

core framework for tgsnake for generating file id

60 lines 1.72 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FileId = void 0; /** * tgsnake - Telegram MTProto framework for nodejs. * Copyright (C) 2022 butthx <https://github.com/butthx> * * THIS FILE IS PART OF TGSNAKE * * tgsnake is a free software : you can redistribute it and/or modify * it under the terms of the MIT License as published. */ const decode_js_1 = require("./decode.js"); const encode_js_1 = require("./encode.js"); var FileId; (function (FileId) { /** * Encoding both fileId and fileUniqueId. */ function encode(file) { return encode_js_1.Encode.encode(file); } FileId.encode = encode; /** * Get only string of file id. */ function encodeFileId(file) { return encode_js_1.Encode.fileId(file); } FileId.encodeFileId = encodeFileId; /** * Get only string of unique id. */ function encodeUniqueId(file) { return encode_js_1.Encode.uniqueId(file); } FileId.encodeUniqueId = encodeUniqueId; /** * Decode both fileId and uniqueId. */ function decode(fileId, uniqueId) { return [decode_js_1.Decode.fileId(fileId), decode_js_1.Decode.uniqueId(uniqueId)]; } FileId.decode = decode; /** * Decode only fileId. */ function decodeFileId(fileId) { return decode_js_1.Decode.fileId(fileId); } FileId.decodeFileId = decodeFileId; /** * Decode only uniqueId */ function decodeUniqueId(uniqueId) { return decode_js_1.Decode.uniqueId(uniqueId); } FileId.decodeUniqueId = decodeUniqueId; })(FileId = exports.FileId || (exports.FileId = {})); //# sourceMappingURL=parser.js.map